我有一个 error.aspx
页。如果用户涉及到该网页,然后将获取的的Page_Load错误路径()
使用方法网址的Request.QueryString [aspxerrorpath]
并能正常工作。
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.QueryString["aspxerrorpath"]
and it works fine.
但是,如果用户直接访问该网页就会产生一个异常,因为 aspxerrorpath
是不存在的。
But if a user directly accesses that page the it will generate an exception because aspxerrorpath
is not there.
我如何检查 aspxerrorpath
有或没有?
您可以只检查空
:
if(Request.QueryString["aspxerrorpath"]!=null)
{
//your code that depends on aspxerrorpath here
}