[英]Show confirm dialog from code behind ASP.NET
我想從代碼后顯示確認對話框。
我有一個確認對話框A。當我單擊A上的OK按鈕時,它被代碼中的方法B調用(使用Ajax發布:url / B,並且B是具有webmethod屬性的方法)。
在方法BI中要顯示其他對話框,並且代碼在流動:( B是AlertInformLogOut)
[WebMethod]
public static void AlertInformLogOut(string alertId, string option)
{
//TODO: Open call schedule
var page = HttpContext.Current.Handler as Page;
// PopUp alert notify info
if (page != null)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "script", "AlertSetDialog(" + new JavaScriptSerializer().Serialize(new AlertInformEntity()) + ", 'AlertInforms');", true);
//ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "script", "AlertSetDialog(" + new JavaScriptSerializer().Serialize(new AlertInformEntity()) + ", 'AlertInforms');", true);
}
}
問題是:對話框不顯示。
有人可以告訴我為什么嗎,並且我可以從具有webmethod屬性的方法顯示對話框。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.