2018年7月18日 星期三

[C# MVC] Force Web Application using HTTPS

Step 1:)

Select your web application > then go to "Properties" windows > set "SSL Enabled" to True

Pay attention to the SSL port




Step 2:)

Open Globa.asax.cs > type the following code

Make sure the SSL port here is equal to the one in web application properties.


Step 3:)

You may add [RequireHttps] to Controllers.



Press Ctrl F5 to test, good luck

沒有留言:

張貼留言