Q:

Calling OnClientClick from Code behind in Asp.net VB

I have code like this :
<asp:LinkButton runat="server" ID="HL_KonfirmasiPemesanan" class="button-primary button-shadow" causesvalidation="false" validationgroup="ValidasiData"  OnClientClick="return getConfirmation(this);"  ></asp:LinkButton>

Then I want call OnClientClick="return getConfirmation(this);" in code behind, I tried:
HL_KonfirmasiPemesanan.Attributes.Add("OnClientClick", "return getConfirmation(this);")

but it doesn't work, how can I do that?

A:

You can do this:
dim script as String = "<script>var btn = document.querySelector('.button-primary'); getConfirmation(btn);</script>"
ClientScript.RegisterStartupScript(Me.GetType(), "click_Btn", script)

