我该怎么做相反[RequireHttps(重定向=真)]在ASP.NET MVC [英] How do I do the OPPOSITE of [RequireHttps(Redirect=true)] in ASP.NET MVC

查看:144
本文介绍了我该怎么做相反[RequireHttps(重定向=真)]在ASP.NET MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道最简单的方式来获得在ASP.NET MVC的SSL页面 - 通过<一个href=\"http://blog.salvoz.com/2009/04/25/PartialSSLAndAuthorizationWithAspNetMVCRevisited.aspx\">[RequireSSL]属性但我有点困惑做相反的最好方法。

I know the easy way to get to an SSL page in ASP.NET MVC - via the [RequireSSL] attribute but I'm a little confused to the best way to do the opposite.

我有一个标题栏在我的网站很多链接和大多数那些链接都不需要SSL,我不希望仍然使用SSL。

I have many links on my site in a header bar and most of those links don't require SSL and I don't want to still use SSL.

期货项目使得它很容易自动重定向到SSL页面 [RequireSSL(重定向= TRUE)] ,但它似乎没有可以很容易地获得出这种情况下自动的和重定向回到HTTP。

The futures project makes it very easy to redirect automatically to an SSL page with [RequireSSL(Redirect=true)], but it doesnt seem to make it easy to get out of this context and automatically redirect back to http.

我是什么失踪?

推荐答案

您不会错过任何东西;有外的开箱没有的功能这一点。您可以轻松地通过采取的RequireSslAttribute源创建你自己的和修改它。

You're not missing anything; there is no out-of-the-box functionality for this. You can easily create your own by taking the RequireSslAttribute source and modifying it.

这篇关于我该怎么做相反[RequireHttps(重定向=真)]在ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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