Runtime error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gagonm
    New Member
    • Oct 2007
    • 26

    Runtime error

    Hi
    I had security audit of my applications.

    I have two applications
    1) .NET 1.0
    2) .NET 1.1

    Here Request is sent in either form of
    https://DNSName:443/virtualdir/~default.aspx
    https://DNSName:443/virtualdir/~default.aspx?P ageId=1234
    Hence application was giving runtime error since web.config mode was set to "RemoteOnly ".
    But when Mode="ON" and defaultRedirect ="AppError.html " ,defaultRedirec t doesn't work.

    To Over Come this problem I handled Application_Err or Event and when URL contain ~ I did Redirect to AppError.html ,it started working when URL is https://DNSName:443/virtualdir/~default.aspx but when URL is https://DNSName:443/virtualdir/~default.aspx?P ageId=1234 even that doesn't work.

    I am frustated since I assume that any unhandled exception in application can be handled in Application_Err or . I am not using any Thread .


    Mock Code
    Void Application_Err or(object sender,EventArg s e)
    {
    try
    {
    if(httpcontext. current.request url!=null && httpcontext.cur rent.requesturl .indexof('~') >0)
    {
    Server.Clear();
    Server.Transfer ("Error.html ");

    }
    }
    catch(Exception ex)
    {

    }

    }





    Thanks
    Jalaj
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Try changing the web.config to NOT be remote_only, so you can see the actual exceptions and correct them

    Comment

    Working...