[英]jgrowl message is displayed unwantedly
try{
myConnection.Open();
SqlCommand myCommd = new SqlCommand(StrMemberId, myConnection);
myCommd.Parameters.AddWithValue("@MemberId", TxtEnterMemberId.Text);
int value=(int)myCommd.ExecuteScalar();
if (value!= 0 )
{
Response.Redirect("GeneralExamination.aspx? MemberId=" + this.TxtEnterMemberId);
}
else
{
string js = "$.jGrowl(' Invalid Member Id Try Again ');";
Page.ClientScript.RegisterStartupScript(typeof(string), "jgrowlwarn", js, true);
TxtEnterMemberId.Text = "";
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally {
myConnection.Close();
}
}
What I am trying to do here is search a Member if does not exist or invalid input jgrowl will show a message(works fine). 我在这里试图做的是搜索一个不存在的成员,或者输入无效的jgrowl将显示一条消息(工作正常)。 i.) Now the problem is when i give the correct memberId a message is generated saying "thread was being aborted." i。)现在的问题是,当我提供正确的memberId时,将生成一条消息,指出“线程正在中止”。 but it does gets redirected to the destined page.What isthe exception about? 但是它确实被重定向到目标页面。例外是什么?
ii.) When i go to the next page and click on the back button.A msg box says"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier." ii。)当我转到下一页并单击“后退”按钮时。一个msg框显示“要显示此页面,Firefox必须发送将重复之前执行的任何操作(例如搜索或订单确认)的信息。 “ if i click resend the growl is displayed again. 如果我单击重新发送,将再次显示咆哮声。 How to deal with that? 怎么处理呢?
Please help to overcome the problems.. 请帮助克服问题。
I) I think that the exception is for making a Response.Redirect inside a try/catch block, to avoid the exception you could add a false parameter to Redirect. 我)我认为该异常是在try / catch块内创建Response.Redirect的,为避免该异常,您可以向Redirect添加一个错误的参数。
more info: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer 更多信息: 如果您使用Response.End,Response.Redirect或Server.Transfer,则会发生ThreadAbortException
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.