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 ExtensionsModulesModulesDualList Control Not Populating On PostBackDualList Control Not Populating On PostBack
Previous
 
Next
New Post
11/15/2011 5:37 PM
 

I noticed that if try to populate the control on a POSTBACK, the control never repopulates, it stays blank.

Help!


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
11/16/2011 10:38 AM
 

I figured out my own answer.  I found that there are TWO DualList controls.  One is an ASPX based WebControl which does not function with POSTBACKS, called DualList.  The other is a class derived server-based control that dynamically draw itself, called DualListBox.

For anyone with this same problem, this is what I did:
   1) Create a new WebControl
   2) Add assembly registration to the Markup page:
          <%@ Register TagPrefix="DNN" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
   3) Add the DNN DualListBox server-based control to your page:
          <DNN:DualListBox ID="dlDualList" runat="server"
                                             AddKey="Add" 
                                             RemoveKey="Remove"
                                             AddAllKey="AddAll" 
                                             RemoveAllKey="RemoveAll"
                                             AddImageURL="~/Images/rt.gif"
                                             AddAllImageURL="~/Images/ffwd.gif"
                                             RemoveImageURL="~/Images/lt.gif" 
                                             RemoveAllImageURL="~/Images/frev.gif"
                                             ContainerStyle-HorizontalAlign="Center">
             <AvailableListBoxStyle CssClass="NormalTextBox" Height="150px" Width="250px" />
             <SelectedListBoxStyle CssClass="NormalTextBox" Height="150px" Width="250px" />
          </DNN:DualListBox>
   4) In the codebehind of your new control, write the code for the 4 buttons Add, AddAll, Remove and RemoveAll
   5) Remember to reassign the lists, DataText property, DataValue property after each "move" and rebind the data
   6) The lists can not be retrieved from the DNN DualListBox control after a postback, so to work around this I saved my lists into SessionVariables
   7) Extra Note: The DataBind doesn't sort your lists, you may want to consider adding a ICompare sort class to handle sorting on the Bind event.


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDualList Control Not Populating On PostBackDualList Control Not Populating 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