pass data from page to page

G

Guest

Is there a way to pass data from page to page without the use of a Session
Variable or queryString?
I need to pass drop down box selections from page to page and have the drop
downs on the page be the same as they were on the page the user is coming
from. I'm using a master page and a sitemap file for my menu.

example:
If I'm in page 1 and I select
BMW in dropdown 1 and 535 in drop down 2
if i select a new page on the menu, the drop downs on that page needs to
have selected BMW (since that drowndown data is on that page as well.)

what is the best way to do this?
 
M

Mark Fitzpatrick

You can also set a cookie. Sometimes this works nicely as the session
management can be a drain on the server whereas the cookie will just be on
the client. Of course, the user may not have their browser to accept
cookies, but that would also provide issues for the session as well since
the id is stored in a cookie unless explicitely using cookieless sessions.

The cookies may be the easiest since they work well with more than ust
ASP.Net and they're pretty lightweight as far as server resources.
 
L

LosManos

hejdig.

Normal posting?

You could program with client side controls.
<form target="otherpage.aspx" method="post">
<select name="ddlCar"><option....
</form>
and on otherpage.aspx.cs
string carID = Request[ "ddlCar" ];

Something like that. I don't have the exact attribute and method names in
my head. Google for ASP solutions.

HTH

/OF

----8<---
 
R

Rad [Visual C# MVP]

Is there a way to pass data from page to page without the use of a Session
Variable or queryString?
I need to pass drop down box selections from page to page and have the drop
downs on the page be the same as they were on the page the user is coming
from. I'm using a master page and a sitemap file for my menu.

example:
If I'm in page 1 and I select
BMW in dropdown 1 and 535 in drop down 2
if i select a new page on the menu, the drop downs on that page needs to
have selected BMW (since that drowndown data is on that page as well.)

what is the best way to do this?

You can investigate the features of asp.net 2 that allow pages to post to
other pages. You can also check out the profile object.

Though i'm curious -- why don't you want to use Sessions?
 
W

Walter Wang [MSFT]

Hi,

In following MSDN documentation:

#How to: Pass Values Between ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.80).aspx

Besides query string and session state, you can use cross-page posting:

#Cross-Page Posting in ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/library/ms178139(VS.80).aspx


or use HttpServerUtility.Transfer():

#HttpServerUtility.Transfer Method (String) (System.Web)
http://msdn2.microsoft.com/en-us/library/y4k58xk7(VS.80).aspx
The Transfer method preserves the QueryString and Form collections.



Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top