I have a problem that a DropDownList is losing its SelectedValue after a PostBack on one server on the web farm. On the other servers, everything is working correctly.
All servers are on the same version of code with the same service packs and all updates applied. The code also works correctly when I run on my local machine (but point at the production database).
I thought ViewState might be the problem, but I confirmed that the web.config, the aspx page, and code are the same across all machines.
I did receive a Input string was not in a correct format. error when trying to Convert.ToInt32().
I added Trace.Write to figure out that the DropDownList value is null on only this particular server.
Code Snippet
protected void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
LoadClientDropDown();
}
}
protected void LoadClientDropDown()
{
//load the drop down ddlClients from data
}
protected void btnSave_Click(object sender, System.EventArgs e)
{
int clientValue = Convert.ToInt32(ddlClients.SelectedValue);
}
What could I be missing?