I have a user control, in the page load of the control I am doing this :
if (ViewState["Lib"] != null)
{
cfg.Lib = (string)ViewState["Lib"];
}
This Lib property can be modified with a textbox like this :
protected void Lib_e_Changed(object sender, EventArgs e)
{
cfg.Lib = Lib_e.Text;
ViewState["Lib"] = Lib_e.Text;
}
I have written the following javascript in my ascx file :
alert('<%= cfg.Lib %>');
It will always return the default value even if I have changed the text in my textbox. My textbox is in an update panel and I have set AutoPostBack to true. Is there something I am missing to update my value ?