Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: ComboBox throws NullReferenceException on PostBack when created but not rendered [26981]

$
0
0
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.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>