我有一个页面 A 执行Response.Redirect("~/dummyPage.aspx");
. 在重定向页面(dummypage.aspx)中,我有这段代码注册了一个要在请求结束时调用的脚本。
public void doStuff(bool isAjaxRequest)
{
var javascript = "alert('hello')";
if (isAjaxRequest)
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), this.ID + "_UpdateBreadCss", javascript, true);
}
else
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ID + "_UpdateBreadCss", javascript, true);
}
}
当我这样做时这不起作用Response.Redirect()
,但如果我在 dummypage.aspx 中它工作正常。
我错过了什么?