Unexpected 404

Discussion in 'ASP .Net' started by Jeremy S, May 28, 2009.

  1. Jeremy S

    Jeremy S Guest

    I have a couple of pages that can handle process optional querystring
    values.

    One of the pages works just fine, with or without a querystring value:
    Requests for each of these result in the page rendering correctly:
    PageOne.aspx
    PageOne.aspx?SC=140

    But I have a second page, in the same folder, that results in the HTTP 404
    page not found error - but *only* when the querysting is included in the
    request.

    This works with no problem:
    PageTwo.aspx

    But a request for this page...results in the HTTP 404
    PageTwo.aspx?SC=45


    When the latter is processed (the request with the querystring present), I
    can step all the way through the code. So the page is in fact being
    requested and processed. So it appears that it's something after the page
    handler processes the page, that is resulting in the HTTP 404.

    FWIW:
    1. I'm using .NET 3.5, asp.net web application, IIS 5.1 (on XP Pro), using
    IE 7.

    2. There is no custom logic in global.asax that does anything with request
    authorization. There is custom authentication logic, but it is processing
    just fine, and the authenticated user is correctly identified.

    3. Here is the relevant Web.config entry (both of the above-described aspx
    pages exist in the "AP" folder.

    <location path="AP">
    <system.web>
    <authorization>
    <deny users="?" />
    <allow users="*"/>
    </authorization>
    </system.web>
    </location>


    Ideas? What can I be looking for to explain and resolve this issue?

    Thanks!

    J
    Jeremy S, May 28, 2009
    #1
    1. Advertising

  2. On May 28, 6:51 am, "Jeremy S" <> wrote:
    > I have a couple of pages that can handle process optional querystring
    > values.
    >
    > One of the pages works just fine, with or without a querystring value:
    > Requests for each of these result in the page rendering correctly:
    >     PageOne.aspx
    >     PageOne.aspx?SC=140
    >
    > But I have a second page, in the same folder, that results in the HTTP 404
    > page not found error - but *only* when the querysting is included in the
    > request.
    >
    > This works with no problem:
    >    PageTwo.aspx
    >
    > But a request for this page...results in the HTTP 404
    >    PageTwo.aspx?SC=45
    >
    > When the latter is processed (the request with the querystring present), I
    > can step all the way through the code. So the page is in fact being
    > requested and processed. So it appears that it's something after the page
    > handler processes the page, that is resulting in the HTTP 404.
    >
    > FWIW:
    > 1. I'm using .NET 3.5, asp.net web application, IIS 5.1 (on XP Pro), using
    > IE 7.
    >
    > 2. There is no custom logic in global.asax that does anything with request
    > authorization. There is custom authentication logic, but it is processing
    > just fine, and the authenticated user is correctly identified.
    >
    > 3. Here is the relevant Web.config entry (both of the above-described aspx
    > pages exist in the "AP" folder.
    >
    > <location path="AP">
    >    <system.web>
    >       <authorization>
    >          <deny users="?" />
    >          <allow users="*"/>
    >       </authorization>
    >    </system.web>
    > </location>
    >
    > Ideas? What can I be looking for to explain and resolve this issue?
    >
    > Thanks!
    >
    > J


    Do you use any url rewriting, some special httpModules? Check IIS log
    to see what was requested.
    Alexey Smirnov, May 28, 2009
    #2
    1. Advertising

  3. Jeremy S

    Jeremy S Guest

    Mystery solved. I had some custom logic that was doing a Response.Redirect
    to a page that had been moved to a new folder. I had not stepped far enough
    through my code, and the Response.Redirect line was in a collapsed section
    of code.

    D'oh! (ala Homer Simpson).




    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "Jeremy S" <> wrote in message
    > news:%...
    >
    >> Ideas? What can I be looking for to explain and resolve this issue?

    >
    > 1) Are you using URL rewriting?
    >
    > 2) Is there anything in Application_BeginRequest in global.asax?
    >
    > 3) Is it specific to a particular querystring, or does any querystring
    > cause the error?
    >
    > 4) Are you using exception handling in the code behind this page? If not,
    > why not?
    >
    > 5) Do you have code in Application_Error in global.asax to handle any
    > unhandled exceptions?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    Jeremy S, May 28, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LL

    404 error?

    LL, Oct 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    455
    Plato
    Oct 3, 2003
  2. NRao

    customErrors 404

    NRao, Jul 1, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    479
    Bassel Tabbara [MSFT]
    Jul 1, 2003
  3. Stoyan
    Replies:
    0
    Views:
    466
    Stoyan
    Jul 10, 2003
  4. joe
    Replies:
    0
    Views:
    424
  5. Jonathan Folland
    Replies:
    2
    Views:
    1,624
    Jonathan Folland
    Mar 17, 2005
Loading...

Share This Page