473,569 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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") = ColumnsListHash Table
Session.Item(Me .ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHash Table = Session.Item(Me .ID & "cols")
StatusHashTable = Session.Item(Me .ID & "status")

End Sub

Nov 19 '05 #1
3 1560
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*******@disc ussions.microso ft.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") = ColumnsListHash Table
Session.Item(Me .ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHash Table = 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*******@dis cussions.micros oft.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") = ColumnsListHash Table Session.Item(Me .ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHash Table = 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*******@disc ussions.microso ft.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*******@di scussions.micro soft.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") =ColumnsListHas hTable Session.Item(Me .ID & "status") = StatusHashTable
End Sub
Private Sub GetState()
ColumnsListHash Table = 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
7093
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 a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the...
0
1306
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 with the html that gets returned. The pages that contain the desired web content reside in the same application as the "caller". The problem is that...
9
2444
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 at http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session, Application and Cache variables on the first page and then on the second...
13
2804
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 visit again .... null ... again .... it works ..... again ... it works ... again ..... null....... and so on and on .... it does randomly work or...
9
1678
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 that entry, and refusing access if the user is already present. However, this gives me a problem if the user forgets to log out, as they then need...
4
4120
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 is pointing to requires logon and is using Forms Authentication. I have set up a web service so that when the user logs on to the smart client, s/he...
18
3422
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 File-New-Window creates an instance of IE in the same process with the same SessionID as the parent window is in big trouble. This fundamentally restricts...
5
2466
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 session data and possibly hijack a session. I've got no clue how to use a table for session management. I've started off by creating a table...
2
4413
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 request. Also Session ID must be unique each time the user logs in. This is required so that Session Hijacking and Session Fixation could be prevented....
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
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 we have to send another system
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.