MVC3 HTTPS和放大器; HTTP [英] mvc3 https & http

查看:118
本文介绍了MVC3 HTTPS和放大器; HTTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的转换asp.net应用程序到MVC3。可以说我有在页面的迹象,需要HTTPS和其他每一页只需要HTTP我怎么能登入重定向到HTTPS,并保持在http?

I am converting an asp.net application into mvc3. Lets say I have a sign in page that requires https and every other page only needs http how can I redirect the signin to https and keep all the other pages on http?

任何建议将是伟大的!

推荐答案

的<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.requirehttpsattribute.aspx\"><$c$c>RequireHttpsAttribute类可能是你想要的。

The RequireHttpsAttribute class may be what you want.

[RequireHttps]
public ActionResult SignIn() {
   return View();
}

这篇关于MVC3 HTTPS和放大器; HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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