In my project am create dynamic controls when page load based on database values. now i need to add click event for asp:label
in jquery
so i tried like this.
ASP.NET
xShowVersion.Style(HtmlTextWriterStyle.Top) = xTop & "px"
xShowVersion.Style.Add(HtmlTextWriterStyle.Height, "40px")
xShowVersion.Style.Add(HtmlTextWriterStyle.Width, "480px")
xShowVersion.Style.Add(HtmlTextWriterStyle.Position, "absolute")
xShowVersion.Style.Add(HtmlTextWriterStyle.Left, "20px")
Dim xlblShow As New Label
xlblShow.Attributes("class") = "downlnkdetails"
xlblShow.Text = "<h2>Show Older Versions<h2>"
xShowVersion.Controls.Add(xlblShow)
DivLeftVersion.Controls.Add(xShowVersion)
JS
<script language="javascript" type="text/javascript">
$(document).ready(function() {
BindButtonClickEvent();
});
function BindButtonClickEvent() {
$('#<%= xlblShow.ClientID %>').click(function() {
alert('Hai');
return false;
});
}
</script>
But its Show Error. How to write event for asp label or any other controls in jquery
?
am Using Asp.Net 2008