Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
302
WebDropDown loses DataItem after postback
posted

Hi

I'm using a WebDropDown with an ItemTemplate that renders multiple columns from an underlying datasource, just like shown in the video from craigshoemaker. I've set the AutoPostback property to true. Everything loads well when I run the page. When I select a value the page does a postback (as desired).
But now all the items from the WebDropDown are empty, however the template-layout is still applied and the Value and Text properties are still filled up.
It seems that the DataItems get null, because they're not being saved in the ViewState?

Is this normal behavior? The only workaround I can find is to DataBind the control on every postback.

I've attached a sample project (VB.NET and version 9.1.20091.2040)

WebDropDownTest.zip
Parents
  • 302
    posted

    Hi Angel

    On one hand I can understand that's not being saved in the ViewState (it would get bloated), on the other hand if you would use multiple WebDropDown-controls that binds on every postback (for instance if they were cascaded), you would also get a performance issue, not?

    Anyway thanks for your help.

     

    Kind regards

    Kevin

Reply Children