Re: dropdownlist box not working correctly

Discussion in 'ASP .Net' started by Hermit Dave, Sep 2, 2004.

  1. Hermit Dave

    Hermit Dave Guest

    show me the page load code. or rather the way you populate the dropdownlist

    you should also use
    if not Page.IsPostBack then

    ' and populate the controls code here

    end if

    (my Bad if the vb.net code is not correct i use c# and here is how you do
    it)

    if(!Page.IsPostBack)
    {
    // populate the data or call a methd that does it.
    }

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Paul" <> wrote in message
    news:...
    > Hi I have a dropdown list box being filled with a stored procedure, this
    > works ok. I have autopostback set to true and on the selectedIndexChanged
    > event for the selected value and selected item it always is the first
    > element
    > no matter what is selected. I set a breakpoint in the event to check, and
    > have the data text field and data value field of the control are both
    > string
    > types as filled by the procedure.
    >
    > Private Sub dr_user_SelectedIndexChanged(ByVal sender As System.Object,
    > ByVal e As System.EventArgs) Handles dr_user.SelectedIndexChanged
    > Dim tmpstring As String
    > Dim tempint As Integer
    > '''''''''''''''''''''''''''''''''''''''''''''''''
    > tmpstring = dr_user.SelectedItem.Text
    > tmpstring = dr_user.SelectedValue.ToString
    > --
    >
    > Paul G
    > Software engineer.
    Hermit Dave, Sep 2, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=

    sort not working correctly

    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    493
    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=
    Aug 18, 2004
  2. Stuart Palmer

    History not working correctly

    Stuart Palmer, Jun 2, 2004, in forum: HTML
    Replies:
    0
    Views:
    370
    Stuart Palmer
    Jun 2, 2004
  3. Gnarlodious
    Replies:
    4
    Views:
    17,553
    elizas
    May 5, 2010
  4. rosemm
    Replies:
    2
    Views:
    773
    Martin Honnen
    Apr 5, 2005
  5. Asus
    Replies:
    1
    Views:
    157
    Joerg Jooss
    Mar 19, 2005
Loading...

Share This Page