More in this section

Forums / Bugs & Issues / SelecteValue of asp:ListBox is always nothing

SelecteValue of asp:ListBox is always nothing

2 posts, 0 answered
  1. William
    William avatar
    4 posts
    21 Oct 2010
    09 Dec 2011
    Link to this post
    We have migrated a site from SF 3.6 to SF 4.3. On this site is a UserControl (ascx_ with a code behind.  The ascx renders fine.  There is a single list box on the page - see below

    <asp:ListBox ID="lbLeadSources" runat="server" SelectionMode="Single" Rows="1" Width="250px"  />
                                            <asp:CustomValidator runat="server" ID="errLeadSource" Font-Bold="true" Font-Size="Smaller"
                                                Font-Italic="true" Display="Dynamic" ControlToValidate="lbLeadSources" ClientValidationFunction="ValidateReqdListBoxItem"
                                                ErrorMessage="<br />* Please select an item from the list" />     

    If I view the soure of the page once rendered in the browser, there are options in the list and I can select a single option from the list. The validation also works fine.  In the code behind, the SelectedValue of the list box is always empty string.  No matter what we do it is always empty string. 

    lead.LeadSourceID = this.lbLeadSources.SelectedValue;

    What is the cause of this and how can we get around this?  Never had this issue with the 3.6 site.

  2. Tim
    Tim avatar
    258 posts
    22 Jun 2011
    09 Dec 2011
    Link to this post

    Any chance we can get a look at the code behind?
2 posts, 0 answered