簡體   English   中英

從代碼隱藏調用 javascript 不起作用

[英]Calling javascript from codebehind not working

<script type="text/javascript">
    function Message() {
        swal("Registration Completed!", "An email will be sent once your access has been accepted.", "success");
    }
</script>

 // Call javascript function
 ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "", "Message()", true);

function 未被調用。 這是我第一次這樣做,我不完全知道它是如何工作的。

String strScript = "window.onload = function() { Message();};";

 // Call javascript function
 ClientScript.RegisterStartupScript(this.GetType(), "Message", strScript, true);

暫無
暫無

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

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