TI have defined a hidden filed in aspx:-
<asp:HiddenField runat ="server" ID="hfBrand" value = "False" />
A combo-box control is calling a JavaScript function function:-
<telerik:RadComboBox ID="Brands" runat="server"
onclientselectedindexchanged="LoadProperties"
AutoPostBack="True">
</telerik:RadComboBox>
In that function , I am trying to set that hidden field value to "True":-
function LoadProperties(sender, eventArgs)
{
var lblBrand = document.getElementById('<%= hfBrand.ClientID %>').value;
alert(lblBrand);
document.getElementById('<%= hfBrand.ClientID %>').value = "True";
var NewlblBrand = document.getElementById('<%= hfBrand.ClientID %>').value
alert(NewlblBrand)
}
On Server Side (Brands.aspx.cs), I'm trying to fetch the hidden field value:-
if (hfBrand.Value == "True")
brandIDSelected = "10";
else
brandIDSelected = "20";
QUESTION:- --> hfbrand.Value is still 'False', even when I had set it to 'True' in javascript. Why it so. Please help.
Thanks