I need to generate a https URL for the action
of a form. It should function on all servers, live, stage, and localhost.
In localhost: localhost:port/submiturl
- no need to https here.
In live: https://domain.com/submiturl
In stage: https://stage.domain.com/submiturl
I cannot put the whole page under SSL, but I specifically need to put the action of the form.
How can I do this programmatically?
Edit:
I've tried action="@Url.Action("Action", "Controller", null, "https")"
But it generates https://localhost/Controller/Action
in localhost, which is not correct.