If you are using ASP.NET MVC 2 Preview 2 or higher, you can now simply use:
[RequireHttps]
public ActionResult Login()
{
return View();
}
Though, the order parameter is worth noting, as mentioned here.
More Related Contents:
- how can I share an asp.net session between http and https
- Can an ASP.NET MVC controller return an Image?
- Biggest advantage to using ASP.Net MVC vs web forms
- SignalR – Sending a message to a specific user using (IUserIdProvider) *NEW 2.0.0*
- ASP.NET Identity DbContext confusion
- Adding ASP.NET MVC5 Identity Authentication to an existing project
- Disable Session state per-request in ASP.Net MVC
- Generating reset password token does not work in Azure Website
- Is it possible to access MVC Views located in another project?
- Global ASAX – get the server name
- Store/assign roles of authenticated users
- Difference between Html.RenderAction and Html.Action
- How to Customize ASP.NET Web API AuthorizeAttribute for Unusual Requirements
- What is the difference between and ?
- Using ASP.Net MVC with Classic ADO.Net
- The anti-forgery cookie token and form field token do not match in MVC 4
- Is current request being made over SSL with Azure deployment
- ASP.NET MVC Relative Paths
- How to do a ASP.NET MVC Ajax form post with multipart/form-data?
- ASP.NET Core change EF connection string when user logs in
- Difference between DropDownlist or DropDownListFor Html helper
- ASP.net MVC4 WebApi route with file-name in it
- Unable to create an object of type ‘[DBContext’s Name]’. For the different patterns supported at design time [closed]
- ‘System.Net.Http.HttpContent’ does not contain a definition for ‘ReadAsAsync’ and no extension method
- Diagnosing 404 errors on IIS 7 and ASP.NET MVC
- ASP.NET MVC3 Role and Permission Management -> With Runtime Permission Assignment
- how to know if the request is ajax in asp.net mvc?
- All requests to ASP.NET Web API return 404 error
- How to decide which is right, WebForms or MVC when doing ASP.NET
- Classic ASP Outbound TLS 1.2