Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > pass data from page to page

Reply
Thread Tools

pass data from page to page

 
 
=?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=
Guest
Posts: n/a
 
      12-04-2006
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?
 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      12-04-2006
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.


--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006



"igotyourdotnet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?



 
Reply With Quote
 
 
 
 
LosManos
Guest
Posts: n/a
 
      12-04-2006
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<---

"igotyourdotnet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?



 
Reply With Quote
 
Rad [Visual C# MVP]
Guest
Posts: n/a
 
      12-04-2006
On Mon, 4 Dec 2006 07:40:00 -0800, igotyourdotnet wrote:

> 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?

--
Bits.Bytes
http://bytes.thinkersroom.com
 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      12-05-2006
Hi,

In following MSDN documentation:

#How to: Pass Values Between ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/lib...fw(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/lib...39(VS.80).aspx


or use HttpServerUtility.Transfer():

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



Sincerely,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between pass by address and pass by reference!! blufox C Programming 2 04-03-2006 02:53 PM
Pass by reference / pass by value Jerry Java 20 09-09-2005 06:08 PM
Large Data pass page by page in ASP.Net ivanlkc@hkem.com ASP .Net 2 08-30-2005 03:07 AM
pass by ref vs pass by pointer Radde C++ 38 08-23-2005 06:29 PM
Pass-by-reference instead of pass-by-pointer = a bad idea? Mr A C++ 111 07-14-2005 03:04 AM



Advertisments