Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
It was just a syntactic error, this works much better:
@Html.PropertyFor(x => x.CurrentBlock.Form, new {XFormParameters = Model.FormParameters} )
I'm having an XForm on a block and I want it to post to a specific controller. I'm tring to use the XFormParameters-class and pass it to the PropertyFor-method, but the controller-part of the form action attribute is not changed as specified by the parameters but the other parameters are included in the action.
I specify XFormParameters like this:
viewModel.FormParameters = new XFormParameters()
{
PostAction = currentBlock.PostAction,
FailedAction = currentBlock.FailedAction,
SuccessAction = currentBlock.SuccessAction,
PostController = currentBlock.PostController
};
and render the xform like this:
@Html.PropertyFor(x => x.CurrentBlock.Form, Model.FormParameters);
Should it be done some other way?