Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one.

I made e page in my project and redirect 404 error to that page.
in this page i have a page that no exists in my project but i need querystring too.

for example if this address made error :
www.mydomain.com/article.aspx?articleID=101

And if my error page is :
www.mydomain.com/error.aspx

so i have this after handle error :

www.mydomain.com/error.aspx?aspxerrorpath=/article.aspx


is there any way that i can find querystring (
?articleID=101
)

Thanks in advance.
Posted
Comments
E.F. Nijboer 22-May-12 3:39am    
Have you checked the event log?
arminamini 22-May-12 4:58am    
No. How can i do this ?
Plz let me know about this log.
Thanks
Vijaykumar Vadnal 22-May-12 8:15am    
from windows run command prompt enter "EventVwr" you will find the event log, chk for your application logs...

you can add a global.asax file to your project, and in your application_error method put this:
C#
protected void Application_Error(object sender, EventArgs e)
  {
      string url = Request.QueryString[0];
      Response.Redirect("/error.aspx?querystring=" + url);
  }

this is not good because this method is for all errors in your root application and you should handle this and customize, you can use ELMAH for tracking error!
 
Share this answer
 
Comments
arminamini 26-May-12 0:53am    
Thanks, Let me check it.
taha bahraminezhad Jooneghani 26-May-12 6:02am    
I checked it, it works!
you have my word!:)
Go to web.config and check


<customerror> 
....
//you will find the redirect url here
</customerror>


make it answer if you find your answer, dont forget to rate


Thanks,

Ashish
 
Share this answer
 
Comments
arminamini 26-May-12 0:54am    
Thanks, But i need queryStrings of the url that user goes, and that page made 404 error

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