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

You are currently viewing the ASP.NET 3.5 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 December 21st, 2009, 01:42 PM
Authorized User
 
Join Date: Jun 2008
Posts: 75
Thanks: 15
Thanked 0 Times in 0 Posts
Default Maintain variable across Postbacks

I have a boolean variable that I want to set to true when the app first loads then after entering a procedure I want to reset it to false and thereafter I want the variable to maintain the false value through the duration of the session.

I tried using a variable and I could not figure out why it get changing and I realized it has to do with postbacks.
 
Old December 21st, 2009, 03:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Can you post the relevant part of the code, and also tell us what you call the app first load?? (because if this is web, there is no first load)...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
dotnetDeveloper (December 21st, 2009)
 
Old December 21st, 2009, 03:56 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

If you want to maintain a variable for the duration of a session, I'd use... let me think... a Session variable? ;)
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following 2 Users Say Thank You to Lee Dumond For This Useful Post:
dotnetDeveloper (December 21st, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
nest radio button lists and postbacks lisabb ASP.NET 2.0 Basics 0 June 6th, 2007 11:41 AM
SessionID changing between postbacks - C# wlangel Visual Studio 2005 1 September 20th, 2006 11:23 AM
how to maintain the records for Reboot Divesh4u Visual C++ 0 June 15th, 2006 07:55 AM
How To maintain dataset between postbacks debuajm ADO.NET 1 March 22nd, 2005 02:32 AM





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