I have an error.aspx page. If a user comes to that page then it will fetch the error path in page_load() method URL using Request.QueryStrin
error.aspx
page_load()
Request.QueryStrin
You can also try:
if (!Request.QueryString.AllKeys.Contains("aspxerrorpath")) return;
What about a more direct approach?
if (Request.QueryString.AllKeys.Contains("mykey")