如何查找用户是否在ASP.NET MVC中运行操作控制器? [英] How do I find if a user run an action controller in ASP.NET MVC?

查看:48
本文介绍了如何查找用户是否在ASP.NET MVC中运行操作控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我只是想知道如果用户先前在控制器中运行了一个Action,这是否可以找到?如果他/她之前运行它应该被限制再次运行相同的动作?



我尝试过:



我没有尝试任何东西。至于我对MVC的新手。

Hi Every Body.
I just want to know that is this possible to find if a user previously run an Action in a controller previously? If he/she did run it before should be restricted running the same action again?

What I have tried:

I haven't tried anything. As far as I am very new to the MVC.

推荐答案

ASP.NET或.NET Framework中没有内置任何内容可以为您完成此任务。你必须自己实现这个问题的适当解决方案。



一个想法是你保存到数据库来跟踪它并在下一个重新加载的状态机请求检查用户所处的状态。您必须自己跟踪状态,因为Web应用程序是无状态的。
There is nothing built into ASP.NET or the .NET Framework that will do this for you. You have to implement an appropriate solution to this problem yourself.

One idea would be a state machine that you save to a database to track this and to reload on the next request to check the state the user is in. You have to track state yourself since web applications are stateless.


这篇关于如何查找用户是否在ASP.NET MVC中运行操作控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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