开发者

Is it possible that each areas on MVC2 run on separate IIS website?

开发者 https://www.devze.com 2023-01-02 12:45 出处:网络
Lets say I want my Admin (area) to run on HTTPS and the default site runs on开发者_C百科 HTTP. Is this possible? How?How to force SSL in MVC 2.0

Lets say I want my Admin (area) to run on HTTPS and the default site runs on开发者_C百科 HTTP.

Is this possible? How?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消