473,384 Members | 1,854 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,384 software developers and data experts.

Remembering values between postbacks

I have 2 private variables in my class that I need to remember the values of
between postbacks (or actually callbacks, since I am using AJAX). I want to
avoid using session variables, if possible. Is there any other way to have
VB.NET maintain the values of these variables between postbacks & callbacks?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Aug 20 '07 #1
4 1206
ViewState

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I have 2 private variables in my class that I need to remember the values
of between postbacks (or actually callbacks, since I am using AJAX). I want
to avoid using session variables, if possible. Is there any other way to
have VB.NET maintain the values of these variables between postbacks &
callbacks? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Aug 20 '07 #2
Eliyahu,

Is this not putting the horse behind the car, using ajax and then send the
variables over the line?

This is more ment for Nathan than for you.

Cor

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgschree f in
bericht news:u9**************@TK2MSFTNGP02.phx.gbl...
ViewState

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I have 2 private variables in my class that I need to remember the values
of between postbacks (or actually callbacks, since I am using AJAX). I
want to avoid using session variables, if possible. Is there any other way
to have VB.NET maintain the values of these variables between postbacks &
callbacks? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Aug 20 '07 #3
I'd suggest you use ViewState in this situation.
Here are some other options, though:
http://SteveOrr.net/articles/PassData.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I have 2 private variables in my class that I need to remember the values
of between postbacks (or actually callbacks, since I am using AJAX). I want
to avoid using session variables, if possible. Is there any other way to
have VB.NET maintain the values of these variables between postbacks &
callbacks? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Aug 20 '07 #4
Re Is there any other way
>to have VB.NET maintain the values of these variables between postbacks
&
>callbacks?
I think the OP has to state clearly whether he is planning on postbacks or
callbacks. ViewState is obviously good for postbacks. This thread may help
for ViewState between callbacks:

http://forums.asp.net/p/1128218/1781727.aspx#1781727

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:84**********************************@microsof t.com...
Eliyahu,

Is this not putting the horse behind the car, using ajax and then send the
variables over the line?

This is more ment for Nathan than for you.

Cor

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgschree f in
bericht news:u9**************@TK2MSFTNGP02.phx.gbl...
ViewState

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I have 2 private variables in my class that I need to remember the
values
>of between postbacks (or actually callbacks, since I am using AJAX). I
want to avoid using session variables, if possible. Is there any other
way
>to have VB.NET maintain the values of these variables between postbacks
&
>callbacks? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Aug 20 '07 #5

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

Similar topics

1
by: Paul Perot | last post by:
Hi All: I have a DataTable that I have defined Globally. I populate this datatable dynamically with file/folder information that I read directly from the server. I use this datatable...
6
by: Neil | last post by:
Hi, I have an aspx page with a number of web controls on it and one of these is a cancel button. I want to check the page to see if the user has changed any of the controls, i..e typed some text...
7
by: cFleury | last post by:
I have an ASP.NET web form that is retaining values over different stations on the network, how can I stop this behavior ?. I didn’t do anything special to cause it. Thanks C.Fleury
0
by: Davey P | last post by:
I have an asp.net table which I am populating with controls dynamically at runtime. The controls themselves get/set values in a datatable which is stored in viewstate over postbacks. Here is...
4
by: bijoy | last post by:
My page has a Listbox called Rooms, a text field called chairPerson and a button called Add. When Add is clicked, the script needs to display the selected info in a datagrid. For example, if...
0
by: Piotrek \Alchemik\ | last post by:
Hello, i have a problem. I created photo as imagemap and i'd like to create hotspots location depending on some values. So at start i have static class where i put all values: class...
0
by: gregfocker | last post by:
I installed the new RTM version of ASP.NET 2.0 AJAX Extensions 1.0 released on Tuesday (1/23). I made the required changes to the web.config file to go from the RC version to the RTM version. ...
4
by: Nathan Sokalski | last post by:
I have 2 private variables in my class that I need to remember the values of between postbacks (or actually callbacks, since I am using AJAX). I want to avoid using session variables, if possible....
2
by: =?Utf-8?B?Sm9obg==?= | last post by:
I have a MyUser class containing user profiles. Everytime after postback, I have to reload (access the database) again. Is there any way I can easily save those data between postbacks? Thanks. ...
2
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose....
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.