I have some working surface controllers that i'm developing. the actions get called from macro partials so they could potentially be used anywhere (http or https pages).
I need to submit a form using ssl then return the same umbraco page (as per the usual way that surface controller actions are procesed).
from what i read Html.BeginUmbracoForm uses a hidden input to pass routing info when the page is posted back to itself.
If i don't use Html.BeginUmbracoForm it will not work as the surfaceControllers return CurrentUmbracoPage OR RedirectToCurrentUmbracoPage and must be a child action.
using [RequireHttps] on the action throws an exception saying that you can't redirect from a child action. So there goes that idea.
So how do i post over https in this situation? (note: i'm new to umbraco)
Please forgive me for saying this, but it's been 6 days now and i haven't got a single reply yet. It's kinda discouraging since posts that came after mine have all received replies. I would like some feedback on how i can improve my request so that i might receive more replies. Is it: too complicated; would take up too much time; not clear enough; so obvious that i should figure it out for myself; unclear title; not enough info; or what?
For now I'm just going to go through the Umbraco source code and copy how the hidden input is created and put that into a regular @Html.BeginForm() and post back to the current page with https.
I don't really like this solution because it could break when future upgrades of umbraco are applied, but for now it will do. If you have any further suggestions i'd love to hear them.
It might be a bit late for you now, but I found a way to do this the other day so thought I'd post a reply for you / anyone who wants to do something similar.
Basically, when you call BeginUmbracoForm you can pass it an object for additional html attributes, one of which can be "action" which would override the default action for the form (which for surface controllers would always be the URL of the current page). What you could do then is provide an action attribute with the current URL, but with the https prefix.
Now when your form renders, it will use YOUR action instead of the default generated one when rendering the form, allowing you to post back to a secure page.
I'm guessing this will be a bit late for you now, but thought I'd post it anyways.
using Html.BeginUmbracoForm with HTTPS
I have some working surface controllers that i'm developing. the actions get called from macro partials so they could potentially be used anywhere (http or https pages).
I need to submit a form using ssl then return the same umbraco page (as per the usual way that surface controller actions are procesed).
from what i read Html.BeginUmbracoForm uses a hidden input to pass routing info when the page is posted back to itself.
If i don't use Html.BeginUmbracoForm it will not work as the surfaceControllers return CurrentUmbracoPage OR RedirectToCurrentUmbracoPage and must be a child action.
using [RequireHttps] on the action throws an exception saying that you can't redirect from a child action. So there goes that idea.
So how do i post over https in this situation?
(note: i'm new to umbraco)
Cheers,
Xander
Please forgive me for saying this, but it's been 6 days now and i haven't got a single reply yet.
It's kinda discouraging since posts that came after mine have all received replies.
I would like some feedback on how i can improve my request so that i might receive more replies.
Is it: too complicated; would take up too much time; not clear enough; so obvious that i should figure it out for myself; unclear title; not enough info; or what?
For now I'm just going to go through the Umbraco source code and copy how the hidden input is created and put that into a regular @Html.BeginForm() and post back to the current page with https.
I don't really like this solution because it could break when future upgrades of umbraco are applied, but for now it will do.
If you have any further suggestions i'd love to hear them.
Cheers,
X
AFAIK it is not possible to use SSL and non-SSL combined in Umbraco. For what I have read it was recommended to have the whole site under SSL.
Hey Xander,
It might be a bit late for you now, but I found a way to do this the other day so thought I'd post a reply for you / anyone who wants to do something similar.
Basically, when you call BeginUmbracoForm you can pass it an object for additional html attributes, one of which can be "action" which would override the default action for the form (which for surface controllers would always be the URL of the current page). What you could do then is provide an action attribute with the current URL, but with the https prefix.
Now when your form renders, it will use YOUR action instead of the default generated one when rendering the form, allowing you to post back to a secure page.
I'm guessing this will be a bit late for you now, but thought I'd post it anyways.
Thanks
Matt
is working on a reply...