G
Guest
I've run into a problem where drop down lists are refusing to data bind with the following error on the DataBind() call
Specified argument was out of the range of valid values. Parameter name: value
Stack trace is showing the error in OnDataBinding event, which I don't hook in the cases where I'm getting this error
ArgumentOutOfRangeException: Specified argument was out of the range of valid values
Parameter name: value
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e
System.Web.UI.Control.DataBind(
Intercede.WebSite.CompanyLocationFieldControl.OnPreRender(EventArgs e) in c:\documents\projects\intercede\intercederelease1\website\reporting\companylocationfield.ascx.cs:9
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Page.ProcessRequestMain(
In each case, the DropDownList datasource is set to a class derived from CollectionBase that contains a list of custom classes. This code used to works in a declared ascx, but I've since moved the code to ascx controls that are dynamically created with Page.LoadControl(...). How this matters I haven't determined, but it seems to. If I move the code back to an ascx that is declared in the hosting aspx, the problem goes away
Any ideas? Does dynamically creating a control with Page.LoadControl() affect data binding events somehow? I'll try to post a code snippet if I can narrow down a reasonable chunk
Specified argument was out of the range of valid values. Parameter name: value
Stack trace is showing the error in OnDataBinding event, which I don't hook in the cases where I'm getting this error
ArgumentOutOfRangeException: Specified argument was out of the range of valid values
Parameter name: value
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e
System.Web.UI.Control.DataBind(
Intercede.WebSite.CompanyLocationFieldControl.OnPreRender(EventArgs e) in c:\documents\projects\intercede\intercederelease1\website\reporting\companylocationfield.ascx.cs:9
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Control.PreRenderRecursiveInternal(
System.Web.UI.Page.ProcessRequestMain(
In each case, the DropDownList datasource is set to a class derived from CollectionBase that contains a list of custom classes. This code used to works in a declared ascx, but I've since moved the code to ascx controls that are dynamically created with Page.LoadControl(...). How this matters I haven't determined, but it seems to. If I move the code back to an ascx that is declared in the hosting aspx, the problem goes away
Any ideas? Does dynamically creating a control with Page.LoadControl() affect data binding events somehow? I'll try to post a code snippet if I can narrow down a reasonable chunk