473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variable scope

What type of variable can you use that lasts between page refreshes is it
possible or do i have to use session or a hidden field

thanks
Nov 17 '05 #1
4 2617
you could use a public static property on a class,
or
Application[]
or
Cache[]
or
Session[]

hth,
Dave
www.aspNetEmail.com

"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
What type of variable can you use that lasts between page refreshes is it
possible or do i have to use session or a hidden field

thanks

Nov 17 '05 #2
You can also try Viewstate["yourkey"] = "value" if you have viewstate
enabled.

George Zacharias.

"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
What type of variable can you use that lasts between page refreshes is it
possible or do i have to use session or a hidden field

thanks

Nov 17 '05 #3
Normally you'd use Session state, or Viewstate, or the Application object,
or the Cache object, or Cookies. A hidden field could also work. They all
have their trade offs.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
What type of variable can you use that lasts between page refreshes is it
possible or do i have to use session or a hidden field

thanks

Nov 17 '05 #4
Vincent,

it's called "buy a basic book on asp/aspx"
or read the included on-line documentation. Some questions are just so
basic that IMHO they don't belong here.
"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
What type of variable can you use that lasts between page refreshes is it
possible or do i have to use session or a hidden field

thanks

Nov 17 '05 #5

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

Similar topics

7
2645
by: YGeek | last post by:
Is there any difference between declaring a variable at the top of a method versus in the code of the method? Is there a performance impact for either choice? What about if the method will return...
3
1986
by: Grant Wagner | last post by:
Given the following working code: function attributes() { var attr1 = arguments || '_'; var attr2 = arguments || '_'; return ( function (el1, el2) { var value1 = el1 + el1; var value2 = el2...
4
14867
by: Gery D. Dorazio | last post by:
Gurus, If a static variable is defined in a class what is the scope of the variable resolved to for it to remain 'static'? For instance, lets say I create a class library assembly that is...
23
19133
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
1
25621
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
0
35189
MMcCarthy
by: MMcCarthy | last post by:
We often get questions on this site that refer to the scope of variables and where and how they are declared. This tutorial is intended to cover the basics of variable scope in VBA for MS Access. For...
2
4691
by: Shraddha | last post by:
Can we declare extern variable as static? What will be the scope of the variable then? What if we change the value of the variable in some other function? Also can someone tell me that if we can...
5
2220
by: somenath | last post by:
Hi All , I have one question regarding scope and lifetime of variable. #include <stdio.h> int main(int argc, char *argv) { int *intp = NULL; char *sptr = NULL;
112
5350
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...
3
2028
by: SRoubtsov | last post by:
Dear all, Do you know whether ANSI C (or some other dialects) support the following: * a variable name coincides with a type name, * a structure/union field name coincides with a type name in...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.