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

Session management in user control

I am using below mention code in a web usercontrol for
session management for hastable objects.
Code works sometime and sometime it doesnt work. Is there
some problme in code:

Private Sub SaveState()

Session.Item(Me.ID & "cols") = ColumnsListHashTable
Session.Item(Me.ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHashTable = Session.Item(Me.ID & "cols")
StatusHashTable = Session.Item(Me.ID & "status")

End Sub

Nov 19 '05 #1
3 1551
Hi vikram:

By not work, do you mean you get a null reference exception?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 9 Apr 2005 01:01:07 -0700, "vikram"
<an*******@discussions.microsoft.com> wrote:
I am using below mention code in a web usercontrol for
session management for hastable objects.
Code works sometime and sometime it doesnt work. Is there
some problme in code:

Private Sub SaveState()

Session.Item(Me.ID & "cols") = ColumnsListHashTable
Session.Item(Me.ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHashTable = Session.Item(Me.ID & "cols")
StatusHashTable = Session.Item(Me.ID & "status")

End Sub


Nov 19 '05 #2
yes i get null objects sometimes and sometimes i get
objects perfectly right.
-----Original Message-----
Hi vikram:

By not work, do you mean you get a null reference exception?
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 9 Apr 2005 01:01:07 -0700, "vikram"
<an*******@discussions.microsoft.com> wrote:
I am using below mention code in a web usercontrol for
session management for hastable objects.
Code works sometime and sometime it doesnt work. Is theresome problme in code:

Private Sub SaveState()

Session.Item(Me.ID & "cols") = ColumnsListHashTable Session.Item(Me.ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHashTable = Session.Item(Me.ID & "cols") StatusHashTable = Session.Item(Me.ID & "status")

End Sub


.

Nov 19 '05 #3
I'd put a breakpoint in both methods, or trace statements, andmake
sure SaveState is always called before GetState.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 10 Apr 2005 01:15:44 -0700, "vikram"
<an*******@discussions.microsoft.com> wrote:
yes i get null objects sometimes and sometimes i get
objects perfectly right.
-----Original Message-----
Hi vikram:

By not work, do you mean you get a null reference

exception?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 9 Apr 2005 01:01:07 -0700, "vikram"
<an*******@discussions.microsoft.com> wrote:
I am using below mention code in a web usercontrol for
session management for hastable objects.
Code works sometime and sometime it doesnt work. Istheresome problme in code:

Private Sub SaveState()

Session.Item(Me.ID & "cols") =ColumnsListHashTable Session.Item(Me.ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHashTable = Session.Item(Me.ID& "cols") StatusHashTable = Session.Item(Me.ID & "status")

End Sub


.


Nov 19 '05 #4

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

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
0
by: Glenn Venzke | last post by:
I have an asp classic app running on W2000/IIS 5. To cut down on page reloads, I am using client-side javascript to retreive web content using the "XMLHTTP" active x control. I then populate divs...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
9
by: Simon Smith | last post by:
Hi, I have a web application in which I need to restrict user access to 1 session per user. I've done this my creating a cache entry when a user logs in, and checking on subsequent logins for...
4
by: pgmanno | last post by:
Hello all, Here is my question. I have an AxWebBrowser (hereafter refered to as "Browser") control framed in a smart client. The smart client requires logon, and the web app that the Browser...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
5
by: rug | last post by:
Hello, I want to use a MySQL Heap table (server load isn't an issue) for session management considering that I use a shared server and don't want anyone who has access to /tmp to be able to read...
2
by: =?Utf-8?B?YW5vb3A=?= | last post by:
Hello, I am developing a Simple ASP Application with a Login page. I want to know how session ID can be generated after User has authenticated instead of generation along with the Login page...
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:
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
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.