Results 1 to 2 of 2

Thread: Drop Down List - Events *RESOLVED*

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Drop Down List - Events *RESOLVED*

    I have a ASP.NET (in VB) project with a drop down list box on my page. The problem is that the SelectedItemChange event does not fire when I select a new item in the list box.

    Here is my code:
    VB Code:
    1. Protected WithEvents ddlHaulageType As System.Web.UI.WebControls.DropDownList
    2.  
    3. Private Sub ddlHaulageType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlHaulageType.SelectedIndexChanged
    4.     Dim ddlItem As System.Web.UI.WebControls.ListItem
    5.  
    6.     ddlItem = ddlHaulageType.SelectedItem()
    7.     ...
    8. End Sub
    I have a stop point on the line that sets the ListItem object to the SelectedItem but the debugger never gets there...
    Last edited by simonm; Apr 18th, 2005 at 10:05 AM.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Drop Down List - Events

    Ah...I've solved it myself.

    I needed to set the AutoPostBack property (of the Drop Down List) to True.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width