![](/img/trans.png)
[英]Is there a way to create a Yes/No popup in ASP.Net VB by calling a function from the code behind?
[英]Calling OnClientClick from Code behind in Asp.net VB
我有这样的代码:
<asp:LinkButton runat="server" ID="HL_KonfirmasiPemesanan" class="button-primary button-shadow" causesvalidation="false" validationgroup="ValidasiData" OnClientClick="return getConfirmation(this);" ></asp:LinkButton>
然后我要致电OnClientClick="return getConfirmation(this);"
在后面的代码中,我尝试了:
HL_KonfirmasiPemesanan.Attributes.Add("OnClientClick", "return getConfirmation(this);")
但这不起作用,我该怎么办?
你可以这样做:
dim script as String = "<script>var btn = document.querySelector('.button-primary'); getConfirmation(btn);</script>"
ClientScript.RegisterStartupScript(Me.GetType(), "click_Btn", script)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.