I have an application developed on MVC2 but I need 开发者_开发技巧it to change from HTTP to HTTPS after authentication. How do I manage that and where do I have to put the code?
Thank you,
Ignacio
Add the filter
[UseHttps]
to your action method
That worked great for me:
http://weblogs.asp.net/jeffwids/archive/2010/08/19/how-to-switch-between-http-and-https-in-asp-net-mvc2.aspx
I added couple of lines to it in order to support ajax requests from shared site master.
http://arturito.net/2011/08/05/how-to-switch-between-http-and-https-in-asp-net-mvc2-and-allow-ajax-requests-from-site-master/
精彩评论