Ajax Control Toolkit version: 3.5.50508
The ComboBox throws a NullReferenceException when it is created and added to the Controls collection but not rendered (ComboBox,Enabled = true, ComboBox.Visible = true). This is being caused by the following code fragment within ComboBox.LoadPostData:
if (this.Enabled)
{
int newSelectedIndex = Convert.ToInt32(postCollection.GetValues(this.HiddenFieldControl.UniqueID)[0], CultureInfo.InvariantCulture);
....
}
It should check if postCollection.GetValues(this.HiddenFieldControl.UniqueID) has a value before performing the conversion.
Comments: I think that I have the same issue. I put the ComboBox control inside a <% if { %> <% } %> and after a Postback i get the NullReferenceException in LoadPostData method. Can you suggest me something to solve this issue? Thank you.
The ComboBox throws a NullReferenceException when it is created and added to the Controls collection but not rendered (ComboBox,Enabled = true, ComboBox.Visible = true). This is being caused by the following code fragment within ComboBox.LoadPostData:
if (this.Enabled)
{
int newSelectedIndex = Convert.ToInt32(postCollection.GetValues(this.HiddenFieldControl.UniqueID)[0], CultureInfo.InvariantCulture);
....
}
It should check if postCollection.GetValues(this.HiddenFieldControl.UniqueID) has a value before performing the conversion.
Comments: I think that I have the same issue. I put the ComboBox control inside a <% if { %> <% } %> and after a Postback i get the NullReferenceException in LoadPostData method. Can you suggest me something to solve this issue? Thank you.