ViewState["BackUrl"] = Request.UrlReferrer.ToString(); 提示需要用new创建实例
ViewState[ "BackUrl "] = Request.UrlReferrer.ToString(); 提示需要用new创建实例,可是ViewState[ "BackUrl "] = new Request.UrlReferrer.ToString(); 依然出错。变成ViewState[ "BackUrl "] = Request.UrlReferrer就不提示错误了,请哪位高人帮忙指点下,谢谢
------解决方案--------------------因为你的Request.UrlReferrer得到的数据是null
------解决方案--------------------Request.UrlReferrer为null 再Tostring就错了
ViewState[ "BackUrl "] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : string.Empty;