While making a website I bumped into a problem. Because I dynamicaly create a "Detail" Button I need to make use of a Hidden Value to see "On Load" wether the button has been clicked.
Wegpage + Jquery part:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="css/assortiment.css" rel="stylesheet" />
<script src="js/jquery.js"></script>
<script type="text/javascript">
function detailKlik()
{
var hid = $('#<%=hd.ClientID %>');
hid.val("true");
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:HiddenField ID="hd" runat="server" Value="abc"/>
...
Whenever I press the dynamicaly generated button I can see that the javascript runs correctly. I can see the original value in the element.
I can even see the "Value" value is changing.
But when I debug in my c# code the value of the HiddenField is just back to the original.
Thank you :)
I have found the problem. Because I tried to access the Object's value in the method protected void Page_Init(...)
I always got the default value.
When I access the value in for example Page Load
I see the correct value.
Thank you!