javascript - Calling OnClientClick from Code behind in Asp.net VB -


i have code :

<asp:linkbutton runat="server" id="hl_konfirmasipemesanan" class="button-primary button-shadow" causesvalidation="false" validationgroup="validasidata"  onclientclick="return getconfirmation(this);"  ></asp:linkbutton> 

then want call onclientclick="return getconfirmation(this);" in code behind, tried:

hl_konfirmasipemesanan.attributes.add("onclientclick", "return getconfirmation(this);") 

but doesn't work, how can that?

you can this:

dim script string = "<script>var btn = document.queryselector('.button-primary'); getconfirmation(btn);</script>" clientscript.registerstartupscript(me.gettype(), "click_btn", script) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -