The action I target needs https. I already have a filter in place that redirects to https if a request comes in via http, but I would prefer to send the request via https right from the start.
EDIT
There was an answer from Darin (updated now to something else ) where he asked why I call this first action by http anyway. He had a good point there and I just updated a couple of links. This was the easiest and securest way to fix my problem.
Once I find the time to evaluate çağdaş answer I will use this as the correct answer, because I guess thats of interest for some other people (...including me in the future)
I don't know if you must use RedirectToAction
but with a UrlHelper
and the controller's Redirect
method you can do this :
public ActionResult SomeAction() {
UrlHelper u = new UrlHelper(this.ControllerContext.RequestContext);
return Redirect(u.Action("actionName", "controllerName", null, "https"));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With