Take the 2-minute tour ×  In the XHTML for a page I have:-
<asp:Button ID="bookNowButton" runat="server"
CssClass="bookNowButton"             OnClientClick="showHideLogg
edInDiv('<%=bookingFormDiv.ClientID%>')" />  This breaks. I need
the correct syntax or method to insert the
bookingFormDiv.ClientID into the control.  What needs to be
done?  share|improve this question Please show a bit more code
for context. –  Robert Massa May 26 '10 at 14:19 what is
rendered to HTML? this looks ok to me –  Pharabus May 26 '10 at
14:24 Including how it breaks (the error message) would be
helpful. –  AaronSieb May 26 '10 at 14:39 add comment  2 Answers
up vote 6 down vote accepted  You can set the attribute from
code behind:  bookNowButton.OnClientClick =
"showHideLoggedInDiv('" + bookingFormDiv.ClientID + "')"
share|improve this answer That worked nicely thanks.
Unfortunately it causes a form post. How do I stop it? I should
explain I'm changing an html <input /> tag into an
<asp:Button></Button> tag. All the button does