Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2003, 10:18 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Values

In old school ASP if I wanted to keep my querystring clean, I would pass values from page to page via hidden inputs. I currently use the ViewState (aka "State Bag") to pass values back to the same page. However, this does not work when navigating to another page.

Official MS documentation suggests creating a custom property on the originating page, and then inheriting it on the receiving page (I'm pretty sure). This seems convoluted to me. Is there a simple solution?

 
Old December 29th, 2003, 03:45 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The viewstate state bag only exists on one page instance. I'm not sure what MS is talking about with that stuff as one page can never see an instance of another page so you would therefore not be able to access another page's property and get anything useful from it. The simplest solution to this necessity is to use the session object as you would have in classic ASP.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 29th, 2003, 04:21 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can also just go and place values in the Querystring as well - it just seems like so much overkill to use the Session for that; I miss the old hidden inputs. :(

In God we trust, everything else we test.
 
Old December 29th, 2003, 04:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, never say never. You *can* do that when you're using Server.Transfer:

http://authors.aspalliance.com/kenc/passval.aspx

http://msdn.microsoft.com/library/de...FormsPages.asp

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing values from dropdownlist sparc ASP.NET 1.0 and 1.1 Basics 2 October 31st, 2005 09:42 AM
passing values and variables anshul Javascript How-To 3 July 26th, 2004 02:30 PM
Passing values between forms alok992 C# 1 April 28th, 2004 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.