I am trying to pass a parameter to my jquery function through the onclick event of a textbox. This is the code:
HTML Code:
<asp:TextBox ID="txtLoginName" OnClick='timepass(<%# Eval("userid")%>);' Text='<%# Eval("LoginName")%>'
runat="server"></asp:TextBox>
and my jquery function:
<script type="text/javascript">
function timepass(pass) {
alert(pass);
}
but nothing happens. When I pass like this on onclick event OnClick="timepass(123)" it works fine.
What am I doing wrong?
LoginNameis a string value so tryOnClick='timepass("<%# Eval("LoginName")%>");'