Click to See Complete Forum and Search --> : dropdownlist in asp.net
anupamgupta
December 11th, 2006, 06:54 AM
Hi,
I am using html dropdownlist (<select ...><option...>...</option></select>) in asp.net
when i try to print the selected value i am getting null values.
can any one tell me how to retrieve data from dropdownlist in
asp.net. I am using asp.net 2.0
I don't want to use dropdownlist control of asp.net.
Anupam
jasonli
December 11th, 2006, 08:48 AM
AS point of my view, you can't get value of client-side control on server-side directly. So you might add a HtmlInputHidden control there, and when you select a certian value in dropdownlist, set the value to hidden control. So, you can get the value on server-side now.
OR, set the dropdownlist control to runat="server" (make it the same as dropdownlist control of asp.net:)).
Charu0306
December 14th, 2006, 06:41 PM
A DDL from asp.net her would be better since it allows you to text/value for it.
Alsvha
December 15th, 2006, 03:56 AM
Hi,
I am using html dropdownlist (<select ...><option...>...</option></select>) in asp.net
when i try to print the selected value i am getting null values.
can any one tell me how to retrieve data from dropdownlist in
asp.net. I am using asp.net 2.0
I don't want to use dropdownlist control of asp.net.
Anupam
If you use normal html - a request form on the name you assign should be enough, just as you would have done prior to .NET.
The request.form method of accessing html controls (not run at server) still work.
canuhelpme
December 16th, 2006, 04:44 AM
use runat="server" in the html control.For eg let the DDL be identified as DDL1.
then on the server side use DDL1.selecteditem.value to access the value.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.