I want to create a custom controller and want to get execute action inside that controller on form submit (customize code). I tried it with umbraco and it worked exactly as required, but the same way it's not working with merchello. Please help guys.
Thanks a lot for your reply. I tried with your suggestion and it worked fine, But when i try to submit the form, i'm not able to invoke the action (HttpPost) of the controller. What should we pass as an action attribute of the form to invoke the custom action of the custom controller in merchello ?
Thanks, I tried this way but not actually worked. I'm getting this kind of error on form submit:
"Cannot create an abstract class."
Look at the screenshot attached here:
Actually I want to customize checkout form and on form submit i want to redirect to custom action of my custom controller. when i try to inspect element and check the form action attribute, seems like it's not changing the action attribute.
Thanks for your immediate replies to my questions. It was the parameter type that created the issue. The type was different from it was passed from view that's why i was getting the kind of error i mentioned in my previous post. Thank you so much :)
Custom controller in Merchello
Hi,
I want to create a custom controller and want to get execute action inside that controller on form submit (customize code). I tried it with umbraco and it worked exactly as required, but the same way it's not working with merchello. Please help guys.
Thanks & Regards
Dharmesh
Wondering if anyone has implemented custom controller in merchello on form submit ?
Hi Dharmesh,
You can do it the same way as a standard Umbraco SurfaceController, but you have to inherit it from MerchelloSurfaceController.
Example:
You can call this for instance in a view, example:
Hi Frans,
Thanks a lot for your reply. I tried with your suggestion and it worked fine, But when i try to submit the form, i'm not able to invoke the action (HttpPost) of the controller. What should we pass as an action attribute of the form to invoke the custom action of the custom controller in merchello ?
Thanks again :) Waiting for your reply :)
Thanks & Regards
Dharmesh
Hi Darmesh,
By using:
in the view, the submit-button within the view will invoke the POST-action.
Hi Frans,
Thanks, I tried this way but not actually worked. I'm getting this kind of error on form submit:
"Cannot create an abstract class."
Look at the screenshot attached here:
Actually I want to customize checkout form and on form submit i want to redirect to custom action of my custom controller. when i try to inspect element and check the form action attribute, seems like it's not changing the action attribute.
I used this form html helper:
But on inspecting form html tag from browser, it displays it's action attribute as:
form action="/checkout/confirm-sale/" enctype="multipart/form-data" method="post">
Thanks & Regards
Dharmesh
This sounds like a problem with the parameter of the actionresult. That cannot be an abstract class, because of bindingproblems.
Hi Frans,
Thanks for your immediate replies to my questions. It was the parameter type that created the issue. The type was different from it was passed from view that's why i was getting the kind of error i mentioned in my previous post. Thank you so much :)
Thanks & Regards
Dharmesh
is working on a reply...