SQL Server SessionState模式 [英] SQL Server SessionState mode

查看:66
本文介绍了SQL Server SessionState模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如果我使用SessionState模式= Sqlserver;我为login_button_click事件声明了一个会话变量,比如



Hi,

If I use SessionState mode= Sqlserver; and i declare a session variable for login_button_click event, like

protected void btn_submit_Click(object sender, EventArgs e)
    {
        Session["Username"] = txt_name.Text;
        Response.Redirect("UserDetails.aspx");
    }





- 用户名会话是否会存储在SqlServer的ASPState数据库中?





- 会话变量在自动存储到SQL服务器时会被序列化吗?



请建议朋友..



-Will the "Username" session be stored in SqlServer's ASPState Database?

and
-Will the Session variable gets Serialized while storing in SQL server automatically?

Kindly suggest friends..

推荐答案

是和是。使用sql对你的代码几乎是透明的,Session会像平常一样工作。在添加对象时,对象需要是可序列化的,但对于本机类型,您不需要做任何不同的事情。

Yes and yes. Using sql should be almost transparent to your code, the Session will work like normal. When it comes to adding objects the object will need to be serialisable, but for native types you don't need to do anything different.


这篇关于SQL Server SessionState模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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