M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

SSL & HTTPS

Websites that require access to sensitive data are always configured to run on HTTPS protocol. System administrators install SSL certificates and websites are developed to support HTTPS protocol. In this tutorial we will see, how M# supports HTTPS protocol and how to enable HTTPS protocol on a whole website or partially for certain pages.

The default protocol for all the pages in M# is HTTP. M# accommodates HTTPS protocol in the framework through “App Setting” or a property “RequiredScheme” on individual page and switches the incoming requests to the appropriate protocol i.e. HTTP or HTTPS .

In order to turn on HTTPS protocol handling for all the webpages, you simply need to add the below “App Setting” in your web.config. M# framework reads this “App Setting” to switch the incoming request protocol

You can specify individual webpage’s request serving protocol by using “EnableSSL” attribute for each page in M#.

The M# page attribute “EnableSSL” generates a property “RequiredScheme” in the backend file of this page and returns a string “https” when set to “True” and “http” when set to “False”. The Protocol return from the method shown below overrides the “App Setting” property value.