Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesListbox with datasource losing items on postbackListbox with datasource losing items on postback
Previous
 
Next
New Post
12/8/2011 6:19 PM
 


This is most likely something I am doing wrong but I cannot track down the issue. I have a listbox that I am populating with a datasource. This listbox is embedded in a view that is embedded in a panel. I have an update button that attempts to read the selections from the listbox. When I select the update button the list box clears all selections. However if I do not use a datasource IE add some test items in a collection for this same listbox then the list box maintains not only the items but the selected items .......so what am I doing wrong to cause the datasource to be lost on a postback for this listbox? Any and all help is appreciated. 

 
New Post
12/9/2011 3:34 AM
 
you need to populate the listbox in page load even on postbacks or enable viewstate.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
12/9/2011 12:51 PM
 

I have enabled view state on this control and that is what is confusing me. I will try populating the listbox at page load and post back and see where that gets me. 

 
New Post
12/9/2011 2:13 PM
 
OK that was pretty dumb on my part. I populated the listbox on page load and on postback and yes the selection items are there but I am unable to grab the items that were selected prior to the update button being selected. I took out the populate section on a postback and the items in the listbox do NOT populate even though the viewstate is enabled.

Any other recommendations?
 
New Post
12/12/2011 9:57 AM
 
Still curious to know what I may have been doing wrong but in the interest of getting this project done simply moved the listbox control out of the views and panels onto the main page and this resolved my issues.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesListbox with datasource losing items on postbackListbox with datasource losing items on postback


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out