C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






How To Clear OR Remove Session Values


Posted Date: 29 Mar 2008    Resource Type: Code Snippets    Category: VB.NET Syntax

Posted By: Jones.E       Member Level: Gold
Rating:     Points: 7



After passing some values Using Session concept , if we click back button we have to face some problems. To avoid that try to follow the below codings.

TO CLEAR THE SESSION VALUE:
-----------------------------------------------



<%@ Page Language="vb" %>
<html>
<head>
<script runat="server">
Sub Page_Load()
Session.Clear()
Message.Text = "There are " & Session.Count & _
" items in the Session collection."
End Sub
</script>
</head>
<body>
<form runat="server">
<asp:label id="Message" runat="server"/>
</form>
</body>
</html>




TO REMOVE THE SESSION VALUE:
-----------------------------------------------




<%@ Page Language="vb" %>
<html>
<head>
<script runat="server">
Sub Page_Load()
If Session.Count > 0 Then
Session.RemoveAll()
Message.Text = "Session collection cleared."
Else
Message.Text = "Session collection is already empty."
End If
End Sub
</script>
</head>
<body>
<form runat="server">
<asp:label id="Message" runat="server"/>
</form>
</body>
</html>







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: File Upload Function
Previous Resource: pagin in the datagrid.
Return to Discussion Resource Index
Post New Resource
Category: VB.NET Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

silicone halloween masks

Contact Us    Privacy Policy    Terms Of Use