i am developing plugin and it works fine, but when i set SSL = true i am getting this error: "Child actions are not allowed to perform redirect actions."
its fails on @Html.Action("Plugin", "MyPlugin") i understand that it fails while trying to redirect to the "https://"
its strange becouse there are some else @Html.Action on this view.
i have added [NopHttpsRequirement(SslRequirement.No)] to the action method but it doesn`t work. what else can i do? any help would be great.
"Child actions are not allowed to perform redirect actions."
That's true. You cannot make redirects in child actions. But you can try the following "hack": 1. Inject IWebHelper in your plugin 2. Open a plugin action method 3. Add the following code to it: if (!_webHelper.IsCurrentConnectionSecured()) { //redirect to HTTPS var thisPageUrl = _webHelper.GetThisPageUrl(true, true); this.Response.Redirect(thisPageUrl); }
i get the error befor it even reach the controller method, so adding " if (!_webHelper.IsCurrentConnectionSecured()) ..." did not helped.
i`m trying to make some banner plugin so it should not make any redirection.
i can`t get why other action methods working fine on the same page, (for example, @Html.Action("HomepagePromotedProducts", "Catalog") works fine) but mine is fails.
i get the error befor it even reach the controller method, so adding
What error are you getting? The same one? I forgot to mention that you have to remove "[NopHttpsRequirement(SslRequirement.No)]" before applying my code.