Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have mostly developed on umbraco 6 sites and want to copy across some code I have used previously to an Umbraco 7 site.
I have a usercontrol to create a form - this is built using aspx and works just fine. On an Umbraco 6 site, I usually add a macro and wrap it in a
For some reason, it's not submitting on my Umbraco 7 site.
When I hit submit, it posts back to the page, but doesn't do anything. If I use a <form runat="server"> tag, it puts it in the body of the page as a literal tag (because it's using MVC I guess?) Is there any way I can recycle my ASPX usercontrol without having to rewrite it in MVC?
There are no errors produced. I've checked the SMTP details in my web.config and they're fine. I've added any dll files to the bin folder, so that's all fine too. Just not sure where to look for an answer to this..
The problem is that you're trying to use WebForms code in MVC templates.. not going to work. You'll need to set up your templates as masterpages.
First of all, go into umbracoSettings.config and find defaultRenderingEngine - this is set to Mvc currently, change it to WebForms.
Now, this doesn't actually do very much, the only thing it really does: when you create a new template from the backoffice, it creates a masterpage now instead of an MVC view.
You will need to one by one delete the MVC templates you have now and re-implement them by re-creating them. So: delete the MVC template, create a new template (likely with the same name), put your WebForms code in there. This also means you'll have to reset all your document types, when you delete a template, the document type also doesn't have this template any more, so make sure to set up the new WebForms template as the template for your document type.
Hopefully you haven't set up too much yet for the site you're working on, then it will be a bit easier to recreate the templates.
I was afraid you'd say that. I was more of a post build requirement.
I'll take a look at building an MVC one. Seems like it will be a lot less hastle!
If you want to create your form in MVC you will need a surface controller :
You can also find some more information and examples here :
And another blog post that we've used on the umbraco courses in the past for a better understanding of what's going on: https://umbraco.com/follow-us/blog-archive/2013/7/14/moving-from-webforms-to-mvc/
Excellent. I'll take a look.
Thanks a lot guys.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted