Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 05, 2013 04:38 AM by Ruchira
Member
39 Points
24 Posts
Jan 02, 2013 03:30 PM|LINK
Hello,
my code for the Application_Error area of Global.asax is pretty messy for my public website. Things that I've had to write code for:
1. Search engine bots that make invalid requests
2. Random web crawling tools by ZmEu and other malicious bots out there
Would anyone be willing to share their code for Application_Error that is a best practice and handles the above?
Thanks!
All-Star
43056 Points
7040 Posts
MVP
Jan 05, 2013 04:38 AM|LINK
You can check the request in your Application_Error method like below
if ((Request.Url.ToString().Contains("malcious_content_here"))) { //Invalid request }
Replace malcious_content_here with whatever text you are going to identify the invalid request.
Please 'Mark as Answer' if this post helps you.
Matt in Camb...
Member
39 Points
24 Posts
Standard Application_Error code for Global.asax
Jan 02, 2013 03:30 PM|LINK
Hello,
my code for the Application_Error area of Global.asax is pretty messy for my public website. Things that I've had to write code for:
1. Search engine bots that make invalid requests
2. Random web crawling tools by ZmEu and other malicious bots out there
Would anyone be willing to share their code for Application_Error that is a best practice and handles the above?
Thanks!
Ruchira
All-Star
43056 Points
7040 Posts
MVP
Re: Standard Application_Error code for Global.asax
Jan 05, 2013 04:38 AM|LINK
Hello,
You can check the request in your Application_Error method like below
if ((Request.Url.ToString().Contains("malcious_content_here"))) { //Invalid request }Replace malcious_content_here with whatever text you are going to identify the invalid request.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.