473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Global variables

How do i create global variables that keep their values
after the form is postback, (i.e. when a button is
clicked, etc.) Thank you very much.
Jul 19 '05 #1
3 4561
Can you be more specific? If you are talking about global
variables, then the Application object can store variables
that are accessible within the whole application.

Tu-Thach
-----Original Message-----
How do i create global variables that keep their values
after the form is postback, (i.e. when a button is
clicked, etc.) Thank you very much.
.

Jul 19 '05 #2
For instance, i would like to have four or five variables
than can be read and written to from my subs and
functions. The problem that i am having is that
everytime a button (asp:button) is clicked these
varaibles loose there values. When i try to only DIM the
variables, when Page.IsPostBack = False, the functions
can't initially see the variables and I recieve
compliation errors. Thank you
-----Original Message-----
Can you be more specific? If you are talking about globalvariables, then the Application object can store variablesthat are accessible within the whole application.

Tu-Thach
-----Original Message-----
How do i create global variables that keep their values
after the form is postback, (i.e. when a button is
clicked, etc.) Thank you very much.
.

.

Jul 19 '05 #3
Jonathan,
ASP.NET has a number of facilities to store variables between round trips
with a client:

The following may be helpful for you to review to find your options:
http://msdn.microsoft.com/library/de...bFormState.asp

Specifically:
http://msdn.microsoft.com/library/de...tateOption.asp

The following article provides a good overview of the 9 options available:
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Hope this helps
Jay

"Jonathan Perkins" <jo*@igetnet.com> wrote in message
news:02****************************@phx.gbl...
For instance, i would like to have four or five variables
than can be read and written to from my subs and
functions. The problem that i am having is that
everytime a button (asp:button) is clicked these
varaibles loose there values. When i try to only DIM the
variables, when Page.IsPostBack = False, the functions
can't initially see the variables and I recieve
compliation errors. Thank you
-----Original Message-----
Can you be more specific? If you are talking about

global
variables, then the Application object can store

variables
that are accessible within the whole application.

Tu-Thach
-----Original Message-----
How do i create global variables that keep their values
after the form is postback, (i.e. when a button is
clicked, etc.) Thank you very much.
.

.

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Matt | last post by:
Greetings, What are people's thoughts on global variables in C++? Why are we taught not to use them in programming? Is it true that if you are running two copies of the C program one copy can...
4
by: Andrew V. Romero | last post by:
I have been working on a function which makes it easier for me to pull variables from the URL. So far I have: <script language="JavaScript"> var variablesInUrl; var vArray = new Array(); ...
12
by: David WOO | last post by:
Hi, I am a newbie on C++, I need to define some global variables which should be accessible to most classes. In the mean time, I don't won't the global variables be modified freely at most of...
2
by: Bryan Parkoff | last post by:
….I would like to know which is the best optimization to use global variable or global struct. I always tell C/C++ Compiler to turn on optimization. ….I use underscore between first name and...
17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
33
by: MLH | last post by:
I've read some posts indicating that having tons of GV's in an Access app is a bad idea. Personally, I love GVs and I use them (possibly abuse them) all the time for everything imaginable - have...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
112
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.