Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Reading The Selected Value In DropDown List

Reply
Thread Tools

Reading The Selected Value In DropDown List

 
 
Guest
Posts: n/a
 
      12-14-2005
Do you have to use AutoPostBack to read the selected value in a dropdown
list? I have an asp.net dropdown on a form. I'm filling it from a table
when the page loads and want to read the value the user selected when they
submit the entire form. But regardless of the value they select, I always
get the first item in the list when I read it. I can get the values from
the text boxes without a problem. But the dropdown list seems to work
differently. What am I doing wrong? Thanks.

Jerry


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      12-14-2005
Jerry,

No, you don't have to use AutoPostBack property. Rather check if you are
using IsPostBack property in the PageLoad event.

Eliyahu

<> wrote in message
news:...
> Do you have to use AutoPostBack to read the selected value in a dropdown
> list? I have an asp.net dropdown on a form. I'm filling it from a table
> when the page loads and want to read the value the user selected when they
> submit the entire form. But regardless of the value they select, I always
> get the first item in the list when I read it. I can get the values from
> the text boxes without a problem. But the dropdown list seems to work
> differently. What am I doing wrong? Thanks.
>
> Jerry
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9l?=
Guest
Posts: n/a
 
      12-14-2005
Jerry,

Please post your code. I'm dealing with a similar issue.

Thanks,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


"" wrote:

> Do you have to use AutoPostBack to read the selected value in a dropdown
> list? I have an asp.net dropdown on a form. I'm filling it from a table
> when the page loads and want to read the value the user selected when they
> submit the entire form. But regardless of the value they select, I always
> get the first item in the list when I read it. I can get the values from
> the text boxes without a problem. But the dropdown list seems to work
> differently. What am I doing wrong? Thanks.
>
> Jerry
>
>
>

 
Reply With Quote
 
Morgan
Guest
Posts: n/a
 
      12-14-2005
Make sure you are not repopulating the drop down list on postback. This will
force you to get the first item in the list.

<> wrote in message
news:...
> Do you have to use AutoPostBack to read the selected value in a dropdown
> list? I have an asp.net dropdown on a form. I'm filling it from a table
> when the page loads and want to read the value the user selected when they
> submit the entire form. But regardless of the value they select, I always
> get the first item in the list when I read it. I can get the values from
> the text boxes without a problem. But the dropdown list seems to work
> differently. What am I doing wrong? Thanks.
>
> Jerry
>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      12-14-2005
That was the issue... I had entered the call below my IsPostBack block...

Thanks!


"Morgan" <> wrote in message
news:u$...
> Make sure you are not repopulating the drop down list on postback. This

will
> force you to get the first item in the list.
>
> <> wrote in message
> news:...
> > Do you have to use AutoPostBack to read the selected value in a dropdown
> > list? I have an asp.net dropdown on a form. I'm filling it from a

table
> > when the page loads and want to read the value the user selected when

they
> > submit the entire form. But regardless of the value they select, I

always
> > get the first item in the list when I read it. I can get the values

from
> > the text boxes without a problem. But the dropdown list seems to work
> > differently. What am I doing wrong? Thanks.
> >
> > Jerry
> >
> >

>
>



 
Reply With Quote
 
tdavisjr
Guest
Posts: n/a
 
      12-14-2005
I had an issue today similar to this; but my issue was the the value
property for each of the list items was not unique. To keep the
selection after postback the value property MUST be unique.

 
Reply With Quote
 
Rajesh
Guest
Posts: n/a
 
      01-08-2006

Hey
Why dont u make use of the ViewState of the control property to reset the
selected value

Rajesh

"tdavisjr" <> wrote in message
news: oups.com...
>I had an issue today similar to this; but my issue was the the value
> property for each of the list items was not unique. To keep the
> selection after postback the value property MUST be unique.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get selected value from dropdown list Andy Sutorius ASP .Net 6 10-29-2012 08:14 PM
Problem with retrieving the selected value in a dropdown list yasodhai@gmail.com ASP .Net 2 03-09-2007 01:16 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
Q: dropdown list, no selected value =?Utf-8?B?SklNLkgu?= ASP .Net 2 04-12-2005 03:38 PM
Re: need selected value from dropdown list box Scott Allen ASP .Net 1 08-25-2004 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57