jgrowl 消息不受欢迎地显示

发布于 2024-08-30 14:01:52 字数 1018 浏览 2 评论 0原文

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();
    }

} 

我在这里尝试做的是搜索成员,如果不存在或无效输入 jgrowl 将显示一条消息(工作正常)。 i.) 现在的问题是,当我给出正确的 memberId 时,会生成一条消息,提示“线程正在中止”。但它确实被重定向到目标页面。异常是什么?

ii.) 当我转到下一页并单击后退按钮时。消息框显示“要显示此页面,Firefox 必须发送将重复之前执行的任何操作(例如搜索或订单确认)的信息。 ”如果我单击重新发送,则会再次显示咆哮声。该怎么处理呢?

请帮助解决问题..

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).
i.) Now the problem is when i give the correct memberId a message is generated saying "thread was being aborted." 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." if i click resend the growl is displayed again. How to deal with that?

Please help to overcome the problems..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀念你的温柔 2024-09-06 14:01:52

I)我认为异常是在 try/catch 块内创建 Response.Redirect ,为了避免异常,您可以向 Redirect 添加一个 false 参数。

详细信息: 如果使用 Response.End、Response,则会发生 ThreadAbortException。重定向或 Server.Transfer

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.

more info: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文