是这样的,我一般用如下两种方式弹出提示Page.ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('" + "操作成功!" + "');</script>");
ScriptManager.RegisterStartupScript(this.gv_OrderInfo, this.gv_OrderInfo.GetType(), "唯一标识符12", "alert('" + "操作成功!" + "')", true);但问题是,弹出过一次以后,就在前台html源码中有了alert代码,html的最后三行代码如下<script>alert('删除失败!');</script></form>
</body>
</html>
这时候问题就来了,无论是我按F5刷新界面,或者按IE上的“后退”按钮或“前进”按钮转到该页时,都弹出这个消息框。
请教各位高手,如何在F5刷新 “前进”后“后退”转到该页时 禁止弹出这个框?
ScriptManager.RegisterStartupScript(this.gv_OrderInfo, this.gv_OrderInfo.GetType(), "唯一标识符12", "alert('" + "操作成功!" + "')", true);但问题是,弹出过一次以后,就在前台html源码中有了alert代码,html的最后三行代码如下<script>alert('删除失败!');</script></form>
</body>
</html>
这时候问题就来了,无论是我按F5刷新界面,或者按IE上的“后退”按钮或“前进”按钮转到该页时,都弹出这个消息框。
请教各位高手,如何在F5刷新 “前进”后“后退”转到该页时 禁止弹出这个框?
<ItemStyle Width="30px"></ItemStyle>
<ControlStyle ForeColor="Blue" />
</asp:ButtonField>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>.cs
需要弹出提示的地方,比如是
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "<script>alert('这是弹出提示!'); </script>";
} protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = ""; }
此时 F5刷新一次, 就自动又去执行RowDeleting事件了 请问应该如何在这种情况下禁止触发RowDeleting
事件
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (SessionCommon.IsHaveSession())
{
NewUI();
}
}
//F5会触发这个,我在这里设置bool值如何?
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (SessionCommon.IsHaveSession())
{
NewUI();
}
}
//F5会执行这个位置,我在这里设置bool值如何? }
可以用Response.Redirect("test.aspx")重新定向到本页面.