Results 1 to 9 of 9

Thread: Getting the value from a dropdownlist [Abandoned]

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Getting the value from a dropdownlist [Abandoned]

    Here's the scenario. I have page with a dropdownlist on it. In the save button's click event, I am retrieving the value like this:

    VB Code:
    1. strDesig = Me.listDesignation.Items(Me.listDesignation.SelectedIndex).Value

    Now this works.

    However, when I set the EnableViewState property of the page to false, the code errors out at the above line, showing me that .SelectedIndex is -1.

    This is despite the control's EnableViewState property being set to True.

    Any clues?
    Last edited by mendhak; May 18th, 2005 at 12:41 AM.

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: Getting the value from a dropdownlist

    I ain't 100% sure but check the HTML source code to make sure there is a viewstate hidden form input. I'm not sure if turning off viewstate for the page forces viewstate not to work for everything?

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Getting the value from a dropdownlist

    About to leave now, I'll look at your answer later. Thanks for replying though.

  4. #4
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Getting the value from a dropdownlist

    DropDownList.AutoPostBack = True; ?

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Getting the value from a dropdownlist

    This problem has been abandoned, thanks for replying though.

  6. #6
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Getting the value from a dropdownlist [Abandoned]

    This problem has been abandoned
    That is a bad attitude....never abondon problems. Solve it...

    Sorry....Just had to get you back!!

  7. #7

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Getting the value from a dropdownlist [Abandoned]

    It somehow solved itself, so I abandoned it. I'm now tearing my hair out over the IE treeview control. A post to come on it soon, perhaps...

  8. #8
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Getting the value from a dropdownlist [Abandoned]

    Hi,

    Not that I'm ANY expert on that (IE TreeView), but let me know if you get stuck.

    Reason I say so is that now I'm testing this WebControl Treeview (at MS) that is nearly the same as the IE webcontrols and I would lke to hear where ppl get stuck.

  9. #9

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Getting the value from a dropdownlist [Abandoned]

    That's great! I'll start a new thread when I get into work, and PM you.

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