我在重新填写网址时遇到错误:
if (!IsPostBack)
{
string req = Request.QueryString["prodID"];
if (req != null)
{
int prodID = int.Parse(Request.QueryString["prodID"]);
koszyk.Dodaj(prodID);
//del prodID from url:
string url = Request.Url.AbsolutePath;
System.Web.HttpContext.Current.RewritePath(url, "", "");
}
}
错误讯息: 虚拟路径执行映射到另一个被禁止的应用程序。
完整日志: System.Web.VirtualPath.FailIfNotWithinAppRoot()+3116542 System.Web.HttpContext.RewritePath(VirtualPath filePath,VirtualPath pathInfo,String queryString,Boolean setClientFilePath)+63 System.Web.HttpContext.RewritePath(String filePath,String pathInfo,String queryString)+48 Zakupy.Page_Load(Object sender,EventArgs e)在c:\ Documents and Settings \ Informatyk \ Pulpit \ NAI \Moduł11\ Problem1,2,3 \ Zakupy.aspx.cs:30 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,Object o,Object t,EventArgs e)+14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e)+35 System.Web.UI.Control.OnLoad(EventArgs e)+91 System.Web.UI.Control.LoadRecursive()+ 74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+2207
当我想要向篮子添加内容时会发生这种情况
任何想法?
答案 0 :(得分:0)
如果url(RewritePath的第一个参数)为空,则会发生同样的错误。