-
您的位置:首页 → 技术开发 → ASP技巧 → ASP.NET:处理session
ASP.NET:处理session
时间:2004/11/7 4:11:00来源:本站整理作者:蓝点我要评论(0)
-
Shivani
Introduction
Hi When I started working with this technology I faced a problem dealing with session as in any transaction or Database oriented portal this is a must requirement to deal with.
Here is a simple example showing the way to maintain session as in the first piece of code it is taking the Author first name then opening the database i am taking authors LastName and AuthorID which is there to put in session which i can access in the next Page. It will be redirected to the next Page and in the Page_Load function only i am printing the Author full name (First and Last name) and Author ID.The only thing to be taken care is give the name which are already there in the DataBase as author first name (Example Jhonson)
Source Code PutSession.aspx, GetSession.aspx
PutSession.aspx
<%@ Page language="C#" enablesessionstate=true%>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
Maintaining Session