Regarding dropdownlist in page and request object

R

Robert Dufour

I have a content page in a site that references a master page. In the
content page I have an aspnet Dropdownlist control that has autopostback set
to true.

I think that when I select another item I should get the value of the
selected item in vb code behind as
Dim myval as string
myval = Request("mydropdownlist")

This works in a page that is not a content page using a master page.
If I use this code in a page that is referencing a master page the value of
Request("mydropdownlist") remains at nothing.
There must be some other way to reference dropdownlist control and the value
of it's selected item that must be different when the content page
references a master page.

Can anyone tell me what it needs to be?
A bit of sample code would be appreciated

Thanks in advance for any help,
Bob
 
D

David Wier

reference the Dropdownlist directly, instead of with Request
Dim myVal as string
myVal=MyDDL.SelectedItem.Text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top