[英]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.