.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How we register httpmodules and httphandler

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

Say I am implementing a HttpModule called my_httpmodule and the class is in \App_Code\myModules folder, do I need to change anything in web.config?

View Complete Post

More Related Resource Links

HttpHandler works with Visual Studio Development Server debugging, but not otherwise


Hi all,

I'm new to HttpHandlers.  I am writing an HttpHandler that reads uploaded files directly from the request stream to provide progress that can be queried using an AJAX request.  For large files, this seems to be faster than having ASP.NET load the file contents into Request.Files and then streaming the file from there to wherever it goes (Linq to SQL into a VARBINARY column in an SQL Server database.)

My HttpHandler works perfectly when I'm debugging using the Visual Studio Development Server, but doesn't work otherwise.  The application pool for this application in IIS 7 is set to run in Classic Mode, and the Handler Mappings screen in IIS says that I must manage managed handlers in system.web/httpHandlers. 

I set up in my applications Web.config file.

<add verb="GET,POST" path="*.upload" type="Namespace.For.UploadHandler, AssemblyForUploadHandler"/>

It works great, so long as I don't debug with the "Use Local IIS Web server" option.

What else do I need to do to get this to work?


spoofing a Page in the httpHandler.



I'm trying to spoof a System.Web.UI.Page in my httphandler, and while this works to some degree.. the "page" needs some added query strings to make this complete. Note below that I'm passing in a virtual path to the Page instance. Can anyone help? I tried adding the query strings to the p.Request object after the Page instance has been instantitated, but I believe the error is -- "Request is not available in this context"

Page p = (Page)BuildManager.CreateInstanceFromVirtualPath(virtualUrl, typeof(Page));

IHttpHandler handler = p;


Generate rss feed with HTTPHandler





I'm looking for link/tutorials/code samples on How to create HttpHandler for generating rss feeds for a website.




URL Routing and Existing HttpHandler problems


Hello everyone,

I have a problem:

I am currently using 2 features: 

1. HttpHandler

Registering the path="res.aspx" verb="*"

2. URL Routing:

Registering with this pattern: "Company/Edit/{*companyId}","~/CompanyEdit.aspx"

In my CompanyEdit.aspx page, I used httphandler res.aspx to generate some images at client.

  • res.aspx?img=1
  • res.aspx?img=3

Now the problem is here, the page is load success with companyId = "12345", but when the images was loaded at client, it loaded the CompanyEdit.aspx again and show error with wrong id.  

I have debug and find the problem that because when image's urls were generated to client with url=res.aspx?img=1, url=res.aspx?img=3, the asp.net will understand that they are Company/Edit/res.aspx?img=1, Company/Edit/res.aspx?img=3 when it maps with URL Routing pattern.

=> So the CompanyEdit.aspx was load again with wrong id (id now is "res.aspx"). 

So, do you have any ideas to solve this problem, or other design.

Thanks, and best regard

Crawler fails to register date properties of user profiles with the month of January, April, August


This seems to be a bug when the crawler search the user profiles in MOSS 2007.  When crawled, user profiles with a SPS-HireDate in the months of January, April, August and December will be detected, but a full-text (SQL) search returns those profiles without the HireDate field.

User profiles with HireDates in other months work correctly, returning the HireDate in the search.  And changing the month of a problematic user profile also fixes the problem.

This problem is also reflected in the fact that while we have 499 user profiles using the SPS-HireDate property,  the managed property page from the search section only has 350 items with the HireDate property.

We're running MOSS 2007 32bit with SP2 with an English language base and the Spanish language pack. I'd considered date format problems, but I can't imagine how some months would work, while others wouldn't.

Any ideas?

Cannot register a service type without attaching the source assembly to the host process

I'm wondering if there is any way I can register a service type without attaching the source assembly to the host process. When I register the service type, the source assembly (which has the type) cannot be written.   I appreciate your attention.. 

Is it possible to Register Assembly System.Runtime.Serialization.dll

I am trying to run a Virtual Earth web service call from SQL server, and need to registier the System.Runtime.Serialization.dll assembly in SQL.  Is this possible?ThanksJay

How can I register a name for a control that is an ItemsControl child?

Hello, How can I register a name for a control that is an ItemsControl child? When I create the controls dynamically in code, the RegisterName works just fine.  However, when those same controls are created by the ItemsControl XAML, RegisterName does not work. Here is the XAML which correctly generates what I want: <Canvas Name="Tab_CanvasTabs"> <Canvas.Resources> <local:CategoryTabs x:Key="myTabs" /> </Canvas.Resources> <ItemsControl Name="Tab_ItemsControl" ItemsSource="{Binding Source={StaticResource myTabs}}"> <ItemsControl.Template> <ControlTemplate TargetType="ItemsControl"> <ItemsPresenter /> </ControlTemplate> </ItemsControl.Template> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <DataTemplate.Resources> </DataTemplate.Resources> <Canvas Name="Tab_Canvas_X" Tag="{Binding Path=Number}" MouseLeftButtonDown="Event_CategoryTab_Canvas_MouseLeftButtonDown" MouseLeftButtonUp="Event

dynamically add control or register and set visibility

I have a classic asp website that I would like to convert to asp.net. The application is structured such that there is one central page that uses "server.execute" to call a page template and the template uses "server.execute" to call the page functionality. I am thinking that I will create a single asp.net page that sits alongside the current page. I can then slowly convert existing page functionality to usercontrols and add a little logic to redirect to the apropriate page based on the requested page functionality. Should I dynamically add the usercontrol to the page for the page functionality or should I register each control on the page and dynamically change the visibility? We don't add new functionality or update the exisiting functionality very often. Most changes are to the content stored in the database used by the pages.

Phillips MP3 player and MTP driver not registering, will only register as a MSC

I have been trying for the past 2 weeks to get my MP3 player to connect as a MTP and not a MSC, unfortunately to no success. We have 3 of the same MP3 players and none of them will connect as a MTP. I can get Rhapsody to work on the cpu, Media Player 11 will work on the cpu but in device manager the MP3 will still come up as a MSC and not a MTP. This cpu is a brand new build with me still using Windows XP PRO from the previous build however I had Media Player 10 on the last build and now I have 11 with the most current Rhapsody version 5.337. My previous build was a P4 this one is a AMD build. I don't believe that is the problem.  I have tried the following items and am at a loss as to what to try next. I have worked with Rhapsody and Phillips on the following items; reinstall all of the Rhapsody software (5 times), reinstall windows media player 11 (3 times), clean and clear MP3 reinstall software (7 times), deleted and reinstalled USB drivers (2 times), reinstalled the MTP drivers seperately and just yesterday I have performed a complete reinstall of windows and all drivers to no avail. MP3 player information is model SA1VBE04KW/17 All windows software is current and up to date. System informatio as follows; Microsoft Windows XP Professional, Verison 2002, Service Pack 3 Computer information; AMD Phenom 8250e, Triple Core Processor, 1.91

Linked server and sensitive to register name of table. Problem with UPDATE.

Hi All. I try to work with table with "sensitive to register" name through Linked Server (MSSQL 2005/2008) and get the problem with UPDATE statement. Reason: MSSQL generates UPDATE statement with "un-quoted" table name. With SELECT/INSERT/UPDATE - no any problems. ----- Linked Database Information: 1. Firebird 2.5 2. OLEDB Provider: IBProvider v3 3. Database dialect: 3 Metadata: CREATE GENERATOR "GEN_ID_TableWithMixName1"; CREATE TABLE "TableWithMixName1" ( TEST_ID INTEGER NOT NULL, "Col" VARCHAR(100), DUMMY_COL INTEGER, CONSTRAINT "PK_TableWithMixName1" PRIMARY KEY (TEST_ID) ); CREATE TRIGGER "BI_TableWithMixName1_TEST_ID" FOR "TableWithMixName1" BEFORE INSERT AS BEGIN IF(NEW."TEST_ID" IS NULL)THEN NEW."TEST_ID" =GEN_ID("GEN_ID_TableWithMixName1",1); END; ------- MSSQL Test 1. MSSQL: select * from IBP_TEST_FB25_D3_V3...TableWithMixName1; IBProvider: Command_Execute   SELECT "Tbl1002"."TEST_ID" "Col1004",         "Tbl1002"."Col" "Col1005",         "Tbl1002"."DUMMY_COL" "Col1006"   FROM "TableWithMixName1" "Tbl1002" No Problem ------- MSSQL Test 2. MSSQL: delete from IBP_TEST_FB25_D3_V3...Tabl

httphandler(.ashx) to an (.aspx) page

How To  Redirect from httphandler(.ashx)  to an (.aspx) page in the same application ? http://forums.asp.net/t/1598111.aspx    can some expert confirm better approach

Error while trying to register DLLs for Microsoft Jet on Windows Server 2008 R2 64bit

Hello! I'm having issues with importing Excel spreadsheets into Microsoft SQL Server 2005 on a Windows Server 2008 R2 64bit server.  After browsing the web, it appears that the problem is with the DLL's used by Microsoft Jet.  I've thus attempted to re-register these DLL's.  However, I am receiving the following results. c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjetoledb40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjet40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjint40.dllThe module "msjint40.dll" was loaded but the entry-point DLLRegisterServer was not found c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjter40.dllThe module "msjter40.dll" was loaded but the entry-point DLLRegisterServer was not found c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\msjtes40.dllSuccessful c:\Windows\SysWOW64> regsvr32 c:\Windows\SysWOW64\mswstr10.dllThe module "mswstr10.dll" was loaded but the entry-point DLLRegisterServer was not found I've set the application pool for this site to use 32bit.  Please note that due to my role on the team, other options such as using ACE are not available to me, unless I can prove that I've exhausted all other options. Thoughts? Thanks,Mike

What are httphandlers and httpmodules?

Hi,Can anybody please tell me in very simple language what httphandlers and httpmodules are.

Can't register VSS Provider COM+ dll object on x64

I have a pair of binaries that implement the VSS Requestor (an executable) and Provider (a dll). The Volume Shadow Copy Service (VSS) is a set of COM interfaces that implements a framework to allow volume backups to be performed while applications on a system continue to write to the volumes. (taken from  http://msdn2.microsoft.com/en-gb/library/aa384961.aspx)The requestor initiates the process, the vss framework then loads the provider.Everything works fine on an x86 platform. We now wish to have it run on x64 as well (aka AMD64, WOW64. Not IA64).The executable itself runs w/o any problems on the x64. However, the dll doesn't register properly. The registration is done using the script register_app.vbs that is supplied with windows SDK.The following line in the script fails: Dim cat cat = CreateObject("COMAdmin.COMAdminCatalog") ... cat.InstallComponent ProviderName, ProviderDLL , "", ""The error output is:Creating a new COM+ application:- Creating the catalog object- Get the Applications collection- Populate...- Add new application object- Set app name = MyVssProvider- Set app description = My VSS Provider- Set app access check = true- Set encrypted COM communication = true- Set secure references = true- Set impersonation = false- Save changes...- Create Windows service running as Local System- Add the DLL componentERROR:- Error code: -214636851

When you register a web service with a Script Manager, does it have a lot of overhead?

Hey all - I've got some UserControls that need to invoke their own Web Services to get some JS work done.  I know I need to register the Web Service with the ScriptManager if I want to call the Web Service from my JavaScript... but is there an overhead with registering the Web Service for every User Control?  There is a chance the user controls aren't even called in the system and I'd hate to have all that extra overhead if there is a lot... otherwise, I'll just register them with the Script Manager. Currently, I'm operating under the idea that the Script Manager does have an unnecessary overhead.  If that's right, how do I dynamically register a script with the Script Manager when Script Manager is stored on the Master Page and I need to register from the User Control.

httpModules - Remove / Clear From Sub Application

My team just converted a .NET 1.1 web application to .Net 2.0 (I know, I know, but going up to 3.5 was not an option at that time.) but the application had to run under a web site that it parents and sub folders would be listed as .NET 1.1 applications whereas its application folder is set to .Net 2.0 in IIS. Place the application in its QA environment the first error that came back was a client side script error of: "-----------------------------------------------------------Message: 'WebForm_PostBackOptions' is undefinedLine: 201Char: 1Code: 0URI: http://localhost/Root_Web/S1test/S2test/RCW/thePage.aspx"----------------------------------------------------------- To give you an idea of the IIS setup Level 1) Root_Web   - .Net 1.1, Web.Config     <httpModules>      <add type="Security.HTTPRequestScan, Security" name="HTTPRequestScan"/>      <add type="PageScruber,Scruber" name="PageScruber" />    </httpModules> Level 2 - Sub Folder) S1test    - .Net 1.1Level 3 - Sub Folder) S2test   - .Net 1.1Level 4 - Sub Folder) RCW    - .Net 2.0, Web.Config       <httpModules>      <remove name="HTTPReque
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend