Tricky stuff with a dropdown

J

Jim Corey

I have an ASP app that I've recreated in ASP.NET and have
a problem recreating one part of it.

The original includes a dropdown (an html select object with name='Origin')
that I populate using javascript when I change a second dropdown. Each time
I change the selection in the second dropdown, it repopulates the other.

When the form posts, I'm in another page and I can get the value using:
Request("Origin")

In ASP.NET, I've recreated the javascript functionality that repopulates
the dropdown (it's now a dropdownlist web control). I hit a button to run
a report but I can't figure out how to capture the text. It's not in
selecteditem.text.

Perhaps I can still use Request, but I'm not sure when.

Note that if I viewsource for the page that the populated values do not
show,
either in ASP or ASP.NET
 
G

Guest

Jim,
If you are adding new items to the select box on the client side using javascript as you described, then ASP.NET will not see those values when you submit the form. You have to use the Request object to get the value in these situations.

Tu-Thach

----- Jim Corey wrote: -----

I have an ASP app that I've recreated in ASP.NET and have
a problem recreating one part of it.

The original includes a dropdown (an html select object with name='Origin')
that I populate using javascript when I change a second dropdown. Each time
I change the selection in the second dropdown, it repopulates the other.

When the form posts, I'm in another page and I can get the value using:
Request("Origin")

In ASP.NET, I've recreated the javascript functionality that repopulates
the dropdown (it's now a dropdownlist web control). I hit a button to run
a report but I can't figure out how to capture the text. It's not in
selecteditem.text.

Perhaps I can still use Request, but I'm not sure when.

Note that if I viewsource for the page that the populated values do not
show,
either in ASP or ASP.NET
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top