因此,这是我检查登录的代码的一部分。
if (password == tbPassword.Text)
{
HttpCookie cookie = Request.Cookies["LOGIN"];
if (cookie == null)
{
cookie = new HttpCookie("LOGIN");
cookie.Values["LOGIN"] = "Y";
}
else
{
cookie.Values["LOGIN"] = "Y";
}
Response.Cookies.Add(cookie);
Server.Transfer("movies.aspx");
但是当我单击“提交”按钮时出现以下错误:
错误System.Threading.ThreadAbortException:线程正在中止。在System.Threading.Thread.AbortInternal()在System.Threading.Thread.Abort(Object stateInfo)在System.Web.HttpResponse.AbortCurrentThread()在System.Web.HttpResponse.End()在System.Web.HttpServerUtility.Transfer C:\ User .............. Login.aspx.cs中的System.Web.HttpServerUtility.Transfer的(String path,BooleanserveForm)在FinalAssignment.Login.btnLogin_Click(Object sender,EventArgs e)的System.Web.HttpServerUtility.Transfer(String path) :第65行
第65行是“ Server.Transfer(“ movies.aspx”);“
该如何解决?