0

Hi Everyone,

I am currently devleloping a web site in VB and ASP.Net...

I have got a dropdownlist box that contains a lot of centre names (being retrieved from an SQL Server database).

I want to end up so that a user selects the name from the dropdownlist, clicks to go on to the next page.

The next page then displays results from the database where the centre = the centre that was selected from the dropdownlist on the previous screen.

What would be the best way to accomplish this?

Would I be right in thinking that I need to set some sort of global variable that contains the value selected from the dropdownlist?

All help and advice will be greatly appreciated.

Many thanks,

Dan

2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by hericles
0

There are two ways of doing it. You can add the variable to a session variable:

Session["variable"] = some variable

and then retrieve it in the page load of the next page.

variable = Session["variable"].ToString();

Or you can use POST or GET to include it in the request to the new page and then use the query string to extract it. Both are easy to implement.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.