onclientclick
is not an HTML attribute. It is a server-side property used for writing the client-side
onclick
attribute, working around the fact that the
OnClick
property wires up the server-side click event.
<asp:Button runat="server" OnClick="Server-side click event handler" OnClientClick="Client-side 'onclick' attribute" .../>
You need to put both sets of client-side code in the
onclick
attribute:
btn.Attributes("onclick") = "javascript:pleaseWait(); document.location='Home.aspx?fid=" & iFID & "&name=' + encodeURIComponent(document.getElementById('txtName').value); return false;"