asp.net中的sessionid [英] sessionid in asp.net

查看:89
本文介绍了asp.net中的sessionid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的应用程序中,我使用sessionid.当我在按钮中编写代码时,单击如下所示:

Hi,

In my application i using sessionid. when i write code in button click like this:

protected void btn_Click(object sender, EventArgs e)
{
    Response.Write(Session.SessionID);
}



每当我单击按钮时,都会为每次单击创建新的sessionid,但是当用户访问该站点时,sessionid将保持不变.当他关闭站点时,会话将关闭.但是在我的情况下,sessionid会创建每个按钮,请单击



when ever i click on button, new sessionid is creating for every click but sessionid will remain same when user visit the site. when he close the site the session is closed. but in my case sessionid is creating every button click

推荐答案

您是否更清楚自己的意思?会话是在用户级别上的,并在特定的登录名中保留给用户.

阅读有关ASP.NET中Sessions的这篇非常不错的文章:
在ASP.Net中浏览会话 [
Could you be little more clear on what you are saying? Session''s are at user level and persists for a user in a particular login.

Go through this very nice article on Sessions in ASP.NET:
Exploring Session in ASP.Net[^]

Hope it helps!


这篇关于asp.net中的sessionid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆