簡體   English   中英

來自服務器端lauch彈出窗口的asp.net c#,並在執行下一行之前等待響應

[英]asp.net c# from server side lauch popup and wait for response before executing next line

我想從C#代碼啟動模式彈出窗口,並等待用戶按下ok按鈕,然后再執行下一個C#行。

我嘗試了以下

 System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "script", alertMessage, true);

但它不會暫停以等待按下確定按鈕並繼續前進。

我也嘗試過

Response.Write(@"<script language='javascript'>alert( " + alertMessage + " );</script>");

但它返回錯誤消息

在此處輸入圖片說明

任何幫助表示贊賞

在aspx頁面上創建一個簡單的方法

  <script type="text/javascript">
        function openModal(id) {
            $(id).modal('show');
        }
    </script>

然后像這樣在代碼中調用此函數

ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('#yourModalID');", true);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM