Results 1 to 2 of 2

Thread: [02/03] dropDownList.SelectedIndexChanged

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Posts
    244

    Unhappy [02/03] dropDownList.SelectedIndexChanged

    i've written following code but the problem is it doesnot change the value "txtModelCode" everytime; another value is selected from the dropdown list

    VB Code:
    1. Private
    2.  
    3. Sub dropModels_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dropModels.SelectedIndexChanged
    4.  
    5. Dim objEquipment As BusinessLogicLayer.Equipments = Equipments.GetModelCode(dropModels.SelectedItem.Value)
    6. txtModelCode.Text = objEquipment.ModelCode
    7.  
    8.  
    9. End Sub

    while the values are loaded during page load

    VB Code:
    1. Private
    2.  
    3. Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4. If
    5.  
    6. Not Page.IsPostBack Then
    7. dropModels.DataSource = Equipments.GetAllModels
    8.  
    9. dropModels.DataTextField = "Model"
    10.  
    11. dropModels.DataBind()
    12.  
    13. Dim
    14.  
    15. objEquipment As BusinessLogicLayer.Equipments = Equipments.GetModelCode(dropModels.SelectedItem.Value)
    16. txtModelCode.Text = objEquipment.ModelCode
    17.  
    18. End
    19.  
    20. If
    21.  
    22. End Sub

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Posts
    244

    Re: [02/03] dropDownList.SelectedIndexChanged

    any idea?

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