闪存相当于ASP.NET MVC 3 [英] Flash equivalent in ASP.NET MVC 3

查看:78
本文介绍了闪存相当于ASP.NET MVC 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个在Ruby on Rails的所谓闪光功能,您可以把一个消息中闪光,重定向,并且消息中提供了一个动作。

There is a feature called 'flash' in ruby on rails where you can put a message in 'flash', redirect, and the message is available in the next action.

闪光灯的使用实例:

有一个控制器动作Account.ChangePassword。如果密码更改成功,会的ChangePassword填补消息密码更改成功闪光,然后重定向到Account.Profile。在Account.Profile,信息可用,因此它可以在个人资料页面显示。

There is a controller action Account.ChangePassword. If password change is successful, ChangePassword will fill flash with a message 'Password change successful', and then redirects to Account.Profile. In Account.Profile, the message is available so it can be displayed in the profile page.

有没有一些ASP.NET MVC相当于3?

Is there something equivalent in ASP.NET MVC 3?

我知道我可以使用TempData的打造这个功能像自己这,但MVC 3有内置的东西吗?

I know I can build this feature myself using tempdata like this, but does MVC 3 have something built in?

推荐答案

没有,到TempData解决办法是你所期待的。什么

No, the TempData solution is what you are looking for.

这篇关于闪存相当于ASP.NET MVC 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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