Tricky stuff with a dropdown

  • Thread starter Thread starter Jim Corey
  • Start date Start date
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
 
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
 
Back
Top