Httphandler - Embed ASP Web Application Into Another?
Apr 4, 2011
Providing web features through a custom HttpHandler such as in Elmah is extremely handy for ASP.NET Web Applications, because the handler can be embedded into any ASP.NET web app. It perfectly fits as a simple way to extend an existing web app. Now, developing any significant set of features through a custom handler is a very tedious process. I am wondering if it is possible to directly embed an ASP.NET Application into another one through a custom handler (as opposed to cut and pasting the whole app in a sub directory). Here is a small list of embedded web app that would be fit for such a purpose:
Health monitoring console. Provisioning console (for cloud web app with auto-scaling). App settings management console (considering a scheme IoC-settings-stored-in-DB). Each one of those web parts could be provided as an HttpHandler; but again implementation is really tedious. Does anyone know how to do that or how to achieve an equivalent behavior?
View 1 Replies
Similar Messages:
Apr 1, 2011
I've recently taken an existing ASP.NET 3.5 web forms application that was upgraded to .NET 4 last year (and has been running fine) and configured it to also run ASP.NET MVC3 following Scott Hanselman's blog post: Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications. It works well and I've successfully begun to introduce views based on Razor and the existing aspx pages continue to work.
The one thing that has stopped working, however, is a custom HttpHandler (our load balancer hits a specific address to ensure the application is available - the handler is for that address). The web.config has always declared the handler in the system.web section like this:
<httpHandlers>
<add verb="*" path="system/heartbeat.aspx"
type="My.Monitor.HttpHandlers.LoadBalancerHandler, My.Monitor"/>
</httpHandlers>
Now we're testing post-MVC3 and I'm getting an exception that reads:
The controller for path '/system/heartbeat.aspx' was not found or does not implement IController. I have defined a RegisterRoutes method in my Global.asax and that method is called from the Application_Start. Within RegisterRoutes I've got the IgnoreRoute declarations from Hanselman's blog:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
which I thought was to prevent the Routing system from taking anything with an extension of .aspx. I can reproduce the issue in VS2010 as I debug, and the deployment environment is running IIS 6. What can I do to prevent the Routing system from trying to handle that address so the custom handler can do it's thing?
View 1 Replies
Sep 8, 2010
I'm going to develop a desktop tool that will require a database.
How would I go about doing it in a way that will allow me to post the code to a website so that all of the desktop applications see a new version and download the database.
View 2 Replies
Mar 22, 2011
I developed a .Net 3.5 x64 web application that includes a custom HttpHandler in the config:
<add path="*.class1" verb="GET" type="ClassLibrary1.Class1Handler"/>
This works when the platform target for ClassLibrary1 is set at x86.
However, when I set this to x64 I get the following error when I run web application starts (it compiles just fine): Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Could not load file or assembly 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Does this mean that a HttpHandler can be compiled at x86 only?That doesn't make much sense to me.Does anyone have an idea of what could be going on?Edit 1:The ClassLibrary1 project is just an empty class library project with a single HttpHandler added (which is also empty).Edit 2:I am also getting these warning messages when compiling, I am pretty sure they have something to do with this problem: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor HttpTestEdit 3:I manually edited the project file to force references to the x64 assemblies, like this:
<Reference Include="$(Windir)Microsoft.NETFramework64v2.0.50727System.dll"/>
This does supress the above warning message, but the problem isn't resolved.
View 2 Replies
Aug 29, 2010
I'm trying to get custom HttpHandler working in my sample web application. I've been experiencing a lot of issues, but finally got stuck with error 500. Application pool is being run in Classic ASP.NET 2.0 mode. Server is IIS 7.5, OS is Win 7 Pro.
Here's a code of my handler:
[Code]....
View 1 Replies
Jan 13, 2011
I have a virtual directory (configured as an application). It will accept requests for all files that exist, but it will not call handlers (system.web/httpHandlers).
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,
[code]...
View 1 Replies
Mar 25, 2011
I have created a handler in IIS7 on a Sample Web site and it works fine .That is i go to the InetMgr Open the Handler Mappings section create a new handler etc. It works fine .
Now i want the create the same handler on an web application which runs on an IIS6 and am unable access my handler . I have tried adding this under the httpHandlers section
<add verb="*" path="SampleHandler.discb"
type="Sample.Web.SampleHandler, Sample.Web" />
Im working on an IIS6 Asp.Net web application but on development server i have IIS7 installed. Nothing works . Am i missing out anything ?
Well this is the message i get when i open the Handler Mappings section
The applicattion is in an application pool that is running in classic mode , so you can manage ISAPI extensions and native modules that are mapped to paths . you must manage managed handlers (system.web/httpHandlers) directly in the configuration file.
View 1 Replies
May 12, 2010
I am developing a web app. My users want to be able to design their own reports. Is there a way I can embed a simple Report Designer in my app? If so, which Report Designer app should I use? The Report Designer should be an existing app. I don't want to create a Report Designer from scratch. More details: My app is an ASP.NET MVC application. But I can use Java based solutions too, using IKVM.
View 1 Replies
Sep 24, 2010
I need to put a Flash Object in my website developed on MVC2 .NET, however the third party who made it just gave me an html with this code.HTML errors apart I don't know how to put it on ASP.NET.
<table width="608" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4">
<tr>
<td height="412">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="runtime" width="608" height="412" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="runtime.swf" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="Runtime_settingPath=modules/main/setting.xml&Runtime_isRemote=false&Runtime_init_module=module1&Runtime_init_scene=scene1.swf" />
<EMBED src="runtime.swf" FlashVars="Runtime_settingPath=modules/main/setting.xml&Runtime_isRemote=false&Runtime_init_module=module1&Runtime_init_scene=scene1.swf" quality=high bgcolor=#CCCCCC WIDTH="608" HEIGHT="412" NAME="runtime" swLiveConnect="true" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</object>
</td>
</tr>
</table>
View 4 Replies
Feb 1, 2011
I want to implement authorization using social networks like twitter, facebook, Linked In. How can I authorized with all social networks into my asp.net C# web application.
View 1 Replies
Jun 28, 2010
In an ASP.NET application, I need to do some changes on every CSS file sent.So I created an HttpHandler (inside the app itself), added:
<add verb="*" path="*.css" type="MyWebsite.CssTestHandler,MyWebsite"/>
to Web.config in system.web/httpHandlers and modified the handler like this:
public void ProcessRequest(HttpContext context)
{
context.Response.Clear();
text.Response.Write("Hello World");
context.Response.End();
}
View 3 Replies
Apr 9, 2010
i know how to implement this thing..
but i have few question like..
wot is the major purpose of using HttpHandler & HttpModules..
and how they work with page life cycle..?did they get executed b4 page life cycle..?where i got more control and more power
in order to utilize HttpHandler & HttpModules..
View 5 Replies
May 25, 2010
Can u explain me what ASHX HttpHandler uses for?
View 7 Replies
Apr 9, 2010
I have an aspx page that I want to convert to an HttpHandler, but I'm struggling withewState that's been used in the code behind of the aspx page
View 2 Replies
Sep 1, 2010
I have created a HttpHandler to be used with SWFUpload to upload images to the server. This upload is done in an administration backend so users need to be authenticated to upload images.Initially I made the whole administration area deny annonymous users but because of the way SWFUpload appears to work it wouldn't work correctly with Forms authentication and would return a 302 status code.I had thought it would be possible to make the location of my handler public in Web.config and use context.User.Identity.IsAuthenticated in my handler to determine if the user is logged in.
View 3 Replies
Sep 10, 2010
How can I tell from within an ASP.NET HttpHandler if it is executing because of a call to Server.Execute("myHandler.ashx")or because of the user linking directly to myHandler.ashx? (Besides using a querystring parameter).
View 2 Replies
Jan 7, 2011
As i know that asp.net fulfill all the requirements for any web application but what are the ground rules for creating custom httphandler and httpmodule in asp.net.Edit:For example I want to fetch image from database then what i should i use httphandler or normally read image from database.If httphandler then why?
View 4 Replies
Jan 28, 2011
Im trying to write a small web application for forwarding requests to my page to the new pages on my web site. First off im implementing a IHttpHandler and in the ProcessRequest method i simple want to print out the requesting page, my conde looks like this:
public class RedirectHandler : IHttpHandler
{
public bool IsReusable
{
get { return true; }
[code]...
View 1 Replies
Nov 26, 2010
Can a httphandler in .net return a value? If yes how?
View 2 Replies
Feb 3, 2011
How to embed VB to asp.net so we could place our program on the net.
View 1 Replies
Jan 15, 2011
So I am working on a project in ASP.NET MVC 2 with C#.I have a View with a file upload but this is a flash component (.swf).The result of the file upload (the storing of the file and processing of data in the database) is done in a HTTPHandler.I would like the HTTPHandler to send information to my active controller.
Is there a way to get the controller that was used to load the view? I'm having problems finding information about it online.
View 1 Replies
Feb 24, 2011
How to encrypt querystring using HttpHandler?
View 1 Replies
Dec 10, 2010
I am trying to pass an exception to an HttpHandler by doing the following:
catch (Exception e)
{
byte[] exceptionData;
MemoryStream stream = new MemoryStream();
BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Persistence));
formatter.Serialize(stream, e);
exceptionData = stream.ToArray();
WebClient client = new WebClient();
Uri handler = new Uri(ApplicationUri, "TransferException.axd");
#if DEBUG
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(BypassAllCertificateStuff);
#endif
try
{
client.UploadData(handler, exceptionData);
}
catch (WebException) { }
}
EDIT
I am getting the following exception on the client.UploadData() line.
"Content-Length or Chunked Encoding cannot be set for an operation that does not write data."
EDIT
Even if I change my call to be client.UploadString(location, "THIS IS A TEST!"); it still fails with the same exception.
View 2 Replies
Apr 1, 2010
I have an website in IIS 6.0 (windows 2003). Inside that I had configured another application (As IIS Application).
Now, When I uncommend a "add verb" tag in main web.config file, the webservice inside the application throws "404 file not found exception" Is there anything which I need to update in child web.config?
View 1 Replies
Mar 15, 2010
My HttpHandler looks like:
[Code]....
How can I cache the entire xml document that I am generating?
Or do I only have the option of caching the DataTable object?
View 1 Replies