0
我有一個ASP.NET Web窗體應用程序。在此應用上的一種形式我上傳文件,然後重定向到某個頁面:在ASP .NET中的替代重定向
string UrlToRedirect = "";
if (formKey != null)
UrlToRedirect = httpRequest.UrlReferrer.GetLeftPart(UriPartial.Path) + "?id=" + formKey.FormKey1.ToString();
else
UrlToRedirect = httpRequest.UrlReferrer.GetLeftPart(UriPartial.Path) + "?state=" + result;
var response = Request.CreateResponse(HttpStatusCode.Moved);
response.Headers.Location = new Uri(UrlToRedirect);
return response;
不知什麼原因(我從來沒有能夠重現它)我有時對生產得到一個錯誤。
由於我無法重現它,我有點陷入困境......我必須解決它,但我並不真正知道發生了什麼問題。
所以我想知道,有沒有另一種方式獲得重定向?
您在生產中遇到什麼錯誤? – krlzlx