如何在MVC-3 Asp.net中创建Session(C#) [英] How to create Session in MVC-3 Asp.net(C#)

查看:53
本文介绍了如何在MVC-3 Asp.net中创建Session(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我对MVC很新..

我要求用会话创建登录表单..

我对会话一无所知..以及如何创建它...



我试了很多从谷歌搜索..但没有解决方案发现哪些教我从开始(基本)..它意味着从哪里开始创建会话..以及如何创建它和语法等...



so有没有人给我建议或提供任何链接,给我所有关于会话的信息(如何创建它,在哪里创建它......等等)???



对不起我的英文..



我也想知道

im使用

< pre lang =cs> HttpContext.current.Session [ UserId] = UserName;

string usernm = HttpContext.current.Session [ UserId]。ToString();





其中未提供.current选项...

那么有没有任何头文件?





在此先感谢..

解决方案

asp .net mvc3支持价值提供商

更多参考:

HTTP://维博。 asp.net/imranbaloch/archive/2011/07/26/using-the-features-of-asp-net-mvc-3-futures.aspx [ ^ ]


也许你应该从学习mvc开始

http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting -started-with-mvc3-part1-cs [ ^ ]


Hi,

I m very new to MVC..
and im asked to create login form with session..
I dont know anything about session.. and how to create it..

I tried a lot to search from google.. but no solution found which teach me from starting(basic).. it means from where to start creating session.. and how to create it and about syntax etc...

so does anyone give me suggestions about that or provide any links which gives me all the information about session(how to create it, where to create it..etc..)???

sorry for my english..

I also wants to know that
i m using

HttpContext.current.Session["UserId"] = UserName;

                       string usernm = HttpContext.current.Session["UserId"].ToString();



where .current option not provided...
so is there any header file for that??


Thanks in advance..

解决方案

asp .net mvc3 supported Value Providers
for more refer:
http://weblogs.asp.net/imranbaloch/archive/2011/07/26/using-the-features-of-asp-net-mvc-3-futures.aspx[^]


perhaps you should start by learning mvc
http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/getting-started-with-mvc3-part1-cs[^]


这篇关于如何在MVC-3 Asp.net中创建Session(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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