Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 13th, 2007, 09:17 AM
Authorized User
Join Date: Jan 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sessions, and passing data to another page

hi guys,
i'm building a web site where i have a lot of pages, in the default page i'm having a menu in this menu i have a callendar a drop down list, in the callendar i need to remember the date selected by the user and for the drop down list i have to remember the value selected by the user, these values i need them to query the database.the first time it works great the selected item in the drop down list can be read by any other page(in different pages i'm taking these values and displaying different graphs and table) but when i change the selected value in the drop down list in the default page, it does not change for the other web pages. i was thinking of storing the whole page in a session, but i do not know how to implement this. or may be you have some other suggestions so when i change the value in the default page it will also passed to the any other page i need and then the change the values for these pages.

any help will be very appreciated.
it is realy starting to annoying me ;(


Old March 13th, 2007, 09:26 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

...Why would you want to store an entire PAGE in session? >< That will crush your server preformance and really isn't practicle.

Only store the value you need in session so, for example, the value from your dropdown might look like this:

Session.Add("dropDown",Convert.ToString(dropdown.S electedItem.Value));

Then to read that value on another page you might do:

int iValue = Convert.ToInt32(Session["dropDown"]);


================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
================================================== =========
Why can't Programmers, program??
================================================== =========
Old March 13th, 2007, 10:21 AM
Authorized User
Join Date: Jan 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts

thanks for your quick reply,
i already tried this, the first time the page loaded the other pages can read the value of the drop down list, but when i changed the vakus of the drop down list it does not changed for the other pages, i'm puting a text label also in the master page so whenever i changed the value of the drop down list it will be showing in the top of the page and it is working but for the other pages inside the contentholder the value does not change it stays the same.
also i have a feature that disable the date better that date.now, so when i run the default or the master page the date is disabled but when i click in another page the date are anabled again, that is why i tought may be holding the information of the whole page will solve that problem, may be you have another suggestion. i'm also a newbies in asp.net, this is my first project.

thanks for helping

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in passing data to next page. Somesh ASP.NET 2.0 Professional 4 March 15th, 2007 10:16 PM
Passing through sessions dmlocke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 May 15th, 2005 11:35 AM
Passing Variables through Sessions dmlocke Beginning PHP 2 April 27th, 2005 05:40 AM
passing through sessions not working dmlocke PHP Databases 2 April 26th, 2005 08:21 AM
Passing value without using sessions lic023 Classic ASP Basics 1 July 20th, 2004 09:58 AM

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