I am using master page and content page. In content page I am using following jquery code
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="jquery-1.4.1.js"></script>
<script type="text/javascript">
$("document").ready(function() {
var y = $("#<%hid.ClientID%>").val();
});
</script>
</asp:Content>
<input type="hidden" id="hid" runat="server" />
When I run this code I am getting this error
Compiler Error Message: CS1002: ; expected
Line 167: @__w.Write("\").val();\r\n });\r\n </script>\r\n\r\n\r\n");
Any solution ?
Right code is
#Tells jquery that find a control with given ID and<%=hid.ClientID%>gives the exactID. Only<%=hid.ClientID%>this will not work.'#<%=hid.ClientID%>'is the right code.