What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

Last post 11-09-2009 2:41 PM by daddybl2002. 7 replies.

Sort Posts:

  • What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-03-2009, 3:57 PM
    • Member
      16 point Member
    • daddybl2002
    • Member since 11-17-2008, 11:59 AM
    • Posts 34

    Hi All,

    I have to maintain a web application that uses the Ajax Control Toolkit. When I compare the web.config file of this application with the recommanded configuration for applications which use the Ajax control toolkit, I notice that the following HttpModule is missing :

    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    But my application works fine !!! My questions are :

    What's the purpose of this HttpModule ?

    Is it really required ? What problem can my application encounter if I don't add this declaration ?

  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-06-2009, 4:43 AM

    Hi daddybl2002,

    The <httpModules> Element

    The <httpModules> element defines HTTP modules used in ASP.NET AJAX.

    The following example shows the <httpModules> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <system.web> element.

    <system.web>

      <httpModules>

        <add/>

      </httpModules>

    </system.web>

    Please refer to this document about the ScriptModule and how to configure ASP.NET AJAX:
    http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx

    Best regards,

    Zhi-Qiang Ni

    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-06-2009, 11:51 AM
    • Member
      16 point Member
    • daddybl2002
    • Member since 11-17-2008, 11:59 AM
    • Posts 34

    Hi,

    Thank you for your reply, but I know what's an HttpModule and I Know what's the purpose of the HttpModules tag.

    I want to know what does the ScriptModule precisely. when i look to  http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx, they indicate : "The <httpModules> element defines HTTP modules used in ASP.NET AJAX." Great by used for what exactly ? And What risk I take if I dont put it ? ther is my questions

    Best regards,

  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-08-2009, 10:25 PM
    Answer

    Hi daddybl2002,

    I cannot find out the detailed description of the ScriptModule’s usage whether in the MSDN or documentation.
    http://msdn.microsoft.com/en-us/library/system.web.handlers.scriptmodule.aspx
    http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx#httpModules

    However, we can use the reflector to view the properties and methods of ScriptModule class.
    http://www.red-gate.com/products/reflector/

    For example, this is the Init method:
    protected virtual void Init(HttpApplication context)
    {
        context.PreSendRequestHeaders += new EventHandler(this.PreSendRequestHeadersHandler);
        context.PostAcquireRequestState += new EventHandler(this.OnPostAcquireRequestState);
        context.AuthenticateRequest += new EventHandler(this.AuthenticateRequestHandler);
        context.EndRequest += new EventHandler(this.EndRequestHandler);
    }
    It handles four events. Now, we can assume that the ScriptModule provides functions about PreSendRequestHeaders, PostAcquireRequestState, AuthenticateRequest and EndRequest event.

    Best regards,

    Zhi-Qiang Ni

    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-08-2009, 10:38 PM
    • Participant
      1,181 point Participant
    • Mohammed Askar
    • Member since 09-01-2009, 8:23 AM
    • Sri Lanka
    • Posts 290
    Please mark as answered, if this help you.
  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-08-2009, 10:40 PM
    • Participant
      1,181 point Participant
    • Mohammed Askar
    • Member since 09-01-2009, 8:23 AM
    • Sri Lanka
    • Posts 290
  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-09-2009, 2:38 PM
    • Member
      16 point Member
    • daddybl2002
    • Member since 11-17-2008, 11:59 AM
    • Posts 34

    @Mohammed askar: I have already write this : "I know what's an HttpModule and I Know what's the purpose of the HttpModules tag"

    So you are completely out..... sorry

    You can't answer someone withount reading his request and understanding his need.

  • Re: What's the purpose of The HttpModule System.Web.Handlers.ScriptModule

    11-09-2009, 2:41 PM
    • Member
      16 point Member
    • daddybl2002
    • Member since 11-17-2008, 11:59 AM
    • Posts 34
    Thank you Zhi-Qiang Ni,
     
    Reflector, we must always think about that

     

Page 1 of 1 (8 items)