如何在MVC中维护会话值? [英] How to maintain session values in MVC?

查看:88
本文介绍了如何在MVC中维护会话值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在MVC中使用像asp.net这样的Session变量吗?



我尝试了什么:



如何在MVC中使用会话管理存储值

Can we use Session variables like asp.net in MVC?

What I have tried:

How to store values in using session management in MVC

推荐答案

简短回答,是的。



除了实际的win-form控件之外,几乎所有来自win-forms的东西都可以在ASP.NET MVC中开箱即用。



当你进入ASP.NET Core MVC时,事情会有所改变,你需要添加内存缓存,分布式内存缓存和AspNetCore.Session
Short answer, yes.

With the exception of the actual win-form controls, just about everything from win-forms is utilizable in ASP.NET MVC out of the box.

Things do change up a little bit when you get to ASP.NET Core MVC, you need to add in Memory Caching, Distributed Memory Cache, and AspNetCore.Session


这篇关于如何在MVC中维护会话值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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