locked
http module - begin request is firing twice in one click RRS feed

  • Question

  • User-2110869424 posted

    I am writing one module to restrict request.

    but when i run it in vs2005 ,and i made error log and checked it,if i request a page the begin request is calling twice.

    when i generated request with reponse.redirect in a loop,it is begin request is firing only once.

     

    as my logger is not working with my iis ,i can not check it with iis ...

     

    what may be the reason of firing the begin request twice in oone hit in address bar.

     

    plz help

    plz help.. 

     

    Tuesday, July 10, 2007 7:45 AM

All replies

  • User1161433742 posted

    Hi,

    Are you sure you are typing the full path of the ASPX in the address bar? E.g. http://localhost/SomeApp/Default.aspx and not http://localhost/SomeApp/. In second case, the web server sends codes to the client that it is being redirected automatically to http://localhost/SomeApp/Default.aspx. The client has to request again with the new path. That might have caused two requests to the web server. Otherwise, I don't see any reason why it will execute twice.

    Tuesday, July 10, 2007 9:02 AM
  • User1622957740 posted

    There may be other things loading like WebResource.axd for example. You should examine the HttpContext.Current.Request.Url to see what the second hit is. Most likely it's WebResource.axd loading up image or script resources of some kind.

    Remember BeginRequest is an ASP.NET Pipeline event and it fires for every request that goes to through the pipeline!

    +++ Rick ---

     

    Tuesday, July 10, 2007 9:23 PM
  • User-2110869424 posted

    Thank u very much rick. 

     Now I have  DIFFERENT  problem.

    when i tried to call my page with the following code in a button clik my module stops executing after 11 th itration .ie begin request is not firing .what may the problem??

    //protected void Button1_Click(object sender, EventArgs e)

    //{

    // for (int I = 0; I < 20; I++)

    // {

    // WebClient WC = new WebClient();

    // WC.DownloadString("http://localhost/iptest/Default2.aspx");

    // }

    }

     

    Plz help

    Tuesday, July 10, 2007 11:23 PM
  • User-900677162 posted

    HI,rekhakm

    In this thread, we are mainly discussing about ths problem as indicated by the first post and the title.
    Since your new question is not directly related to the original issue, it would be best if you open up a new thread for the new question. In this way, our discussion here will not deviate too much from the original issue. This will make answer searching in the forum easier and be beneficial to other community members as well.
    Thank you for your understanding.

     

    Wednesday, July 11, 2007 10:16 PM