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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.