T
tshad
Using VS 2005, I have the following linkbutton:
<asp:LinkButton ID="lnkSendEmail" runat="server" Text="Send Email"
CssClass="cssbutton"
Width="165px" OnClick="lnkSendEmail_Click"
CausesValidation="False" />
I want to add a Javascript to it so I do the following in my Page_Load
(!IsPostBack) event:
lnkSendEmail.OnClientClick = "Email(this);";
Here is the code that is rendered:
<a onclick="Email(this);" id="ctl00_mContentPlaceHolder_lnkSendEmail"
class="cssbutton"
href="javascript:__doPostBack('ctl00$mContentPlaceHolder$lnkSendEmail','')"
style="display:inline-block;width:165px;">Send Email</a>
So the onclick is there, but it never gets done - I assume because of the
postback, but not sure.
How would I fix this to do this javascript?
Thanks,
Tom
<asp:LinkButton ID="lnkSendEmail" runat="server" Text="Send Email"
CssClass="cssbutton"
Width="165px" OnClick="lnkSendEmail_Click"
CausesValidation="False" />
I want to add a Javascript to it so I do the following in my Page_Load
(!IsPostBack) event:
lnkSendEmail.OnClientClick = "Email(this);";
Here is the code that is rendered:
<a onclick="Email(this);" id="ctl00_mContentPlaceHolder_lnkSendEmail"
class="cssbutton"
href="javascript:__doPostBack('ctl00$mContentPlaceHolder$lnkSendEmail','')"
style="display:inline-block;width:165px;">Send Email</a>
So the onclick is there, but it never gets done - I assume because of the
postback, but not sure.
How would I fix this to do this javascript?
Thanks,
Tom