views:

33

answers:

1

Lets say I want my Admin (area) to run on HTTPS and the default site runs on HTTP.

Is this possible? How?

A: 

How to force SSL in MVC 2.0

public AccountController: Controller{
   [RequireHttps(Order=1), Authorize(Roles="Users",Order=2)]
   public ActionResult Login(){
      // Add login logic
      return View();
    } 
}

The only other thing you will need to do is setup your SSL cert in IIS, but don't require it if you only want to use it in certain areas/controllers/functions.

Tommy