QueryString and Frames

D

David Krussow

I have three aspx pages that are displayed to the user in a frameset. One
aspx page holds title information and displays in the top frame, the aspx
page in the left frame lists products, and the aspx page in the right frame
shows product details.

When the user first opens the ASP.NET Web application, the default page is
displayed (which is not the product catalog described above). The main
application menu contains links for various catalogs ("Widgets",
"Thingies"... and other catalogs). When the user selects one of the catalogs
from the menu, the frameset page is opened, and a QueryString value (e.g.,
?CatalogID=43) is passed in to control which catalog is displayed .

My question: Being that the QueryString variable (?CatalogID) is getting
passed to the frameset page, how do I make the value of CatalogID available
to the code-behind module of the aspx page in the left frame that lists the
products. This is the page that really needs the CatalogID value.

Thanks!
 
G

Guest

You could get the URL params via.

Request("CatalogID"

if not , one more alternative solution is

place <input type=hidden id=myHidden value="<%=Request("CatalogID")%>" runat=server> in one of the frames which are having URL param, so in code behind access myHidden.Value
 
J

Jean-Luc David [MVP]

Hi David,

You can easily store the information in a cookie. That way, it is available
through code behind to any pages you want. For example:

Dim currentCatalogID As HttpCookie = New HttpCookie("catalogID")
currentCatalogID.Value="48"
currentCatalogID.Expires=#12/31/2004#
Response.Cookies.Add(currentCatalogID)

Here is a Microsoft Quickstart with various examples showing how to
maintain data across multiple aspx pages:

http://msdn.microsoft.com/library/en-us/cpqstart/html/cpsmpnetsamples-aspnetwebapplications.asp

Hope this information helps.
Jean-Luc
Microsoft .NET MVP
(e-mail address removed)
http://www.stormpixel.com
 

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,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top