How to Generate absolute urls with https in MVC3?

前端 未结 4 1767
天命终不由人
天命终不由人 2020-12-16 12:40

I am using MVC3 and am trying to serve content from https, the problem is that when I call Url.Content the files are still served from http using a relative url. I thought t

4条回答
  •  醉酒成梦
    2020-12-16 13:18

    You can use Url.RouteUrl, some of the overloads take a protocol parameter, looks something like this:

    Url.RouteUrl("Product", new { itemId = "123456" }, "https");
    

    Take a look a the overloads and see which one you can use

提交回复
热议问题