1

实际上,我需要显示Success Message并单击后OK,应该Redirect我到另一个Page
到目前为止,一切正常。但放置后UpdatePanelAlert没有显示。

我的代码:

ClientScript.RegisterStartupScript(typeof(Page), "Create Time Table", "<script language='JavaScript'>alert('Time Table Created Successfully.'); window.location.href = 'create.aspx';</script>");

我试过:

ClientScript.RegisterStartupScript(typeof(Page), "Create Time Table", "<script language='JavaScript'>alert('Time Table Created Successfully.'); window.location.href = 'create.aspx';</script>",true);

ClientScript.RegisterStartupScript(typeof(Page), "Create Time Table", "<script language='JavaScript'>alert('Time Table Created Successfully.'); window.location.href = 'create.aspx';</script>",false);

但是,这些都不起作用:(

4

1 回答 1

4

如果您有更新面板,请提供更新面板 ID 及其类型,如下所示

ScriptManager.RegisterStartupScript(
                UpdatePanelID,
                UpdatePanelID.GetType(), 
                "Create Time Table", 
                " alert('Time Table Created Successfully.'); window.location.href = 'create.aspx';",
                true);
于 2013-08-26T02:23:56.473 回答