Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem in getting selected value from dropdownlist when using Array as datasource

    Hi All,
    I have used a string array as datasource for a dropdownlist. When getting the selected value from the dropdownlist in the postback, I am getting always the first value even though some other item is selected. Can any one help me to find a soultion for this problem?

  • #2
    New Coder
    Join Date
    Mar 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you submit the page its posting back, rebinding the drop down list. Simple put "If Not IsPostBack then" into your page load, something like below.

    Sub Page_Load()
    If Not IsPostBack Then
    Page Load Stuff
    End If
    End Sub

  • #3
    New Coder
    Join Date
    Oct 2005
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how r u taking selected value from dropdownlist
    try this

    Response.Write(DropDownList1.SelectedValue);


  •  

    Posting Permissions

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