Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have created two classes
C#
public class ClshttpModule:IHttpModule
{
    private HttpApplication httpapp;
    public static ArrayList objarlist = new ArrayList();

    public ClshttpModule()
    {
      }
    public void Dispose()
    {

    }

    public void Init(HttpApplication context)
    {
        this.httpapp = context;
        httpapp.Context.Response.Clear();
        objarlist.Clear();
        objarlist.Add("httpModule:init");
        httpapp.AuthenticateRequest += new EventHandler(OnAuthentication);
        httpapp.AuthenticateRequest += new EventHandler(OnAuthorization);
        httpapp.BeginRequest += new EventHandler(OnBeginrequest);
        httpapp.EndRequest += new EventHandler(OnEndrequest);
        httpapp.ResolveRequestCache += new EventHandler(OnResolveRequestCache);
        httpapp.AcquireRequestState += new EventHandler(OnAcquireRequest);
        httpapp.PreRequestHandlerExecute += new EventHandler(PreRequestHandlerExecute);
        httpapp.PostRequestHandlerExecute += new EventHandler(PostRequestHandlerExecute);
        httpapp.ReleaseRequestState += new EventHandler(ReleaseRequestState);
        httpapp.UpdateRequestCache += new EventHandler(UpdateRequestCachee);
            }

    void UpdateRequestCachee(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void ReleaseRequestState(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void PostRequestHandlerExecute(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void PreRequestHandlerExecute(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void PreRequestHandlerExecuteOnAcquireRequest(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnAcquireRequest(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnResolveRequestCache(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnEndrequest(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnBeginrequest(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnAuthorization(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }
    void OnAuthentication(object sender, EventArgs e)
    {
        objarlist.Add("httpModule:OnupdateCache");

    }

}


in default.aspx

XML
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
       <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
           ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>



web.config
XML
<httpModules>
            <add name="ClshttpModule"  type="ClshttpModule"/>

        </httpModules>
        <httpHandlers>
            <add verb="*" path="*.jpg" type="clsHttpHandler"/>
        </httpHandlers>




I am not getting any outputt

pls tell regards
Posted
Comments
shivani 2013 18-Jan-13 8:00am    
is there no one who could help me out of this..........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900