I have been using Umbraco for a few years and have always used Webforms. After avoiding Umbraco 7 for a while, I decided to move with the times and use it for a new website I am building. Umbraco 7.4.2 was the latest release and when I installed it, the automatic rendering engine was MVC. I struggled to get it switched to Webforms so I stuck with it. Now I'm occurring issues because I need to use usercontrols but this obviously requires Webforms.
Can anyone give me some advice as to what I need to do to switch to Webforms?
I have already changed the rendering engine to Webforms in the umbracoSettings file, I just need some help changing the code on my templates to work with Webforms.
I don't think you can convert an Umbraco template between MVC/web forms. What you can do is create a new template (use a different name, or issues may arise) and it should be a web forms template now that you've modified the configuration (assuming you've modified the correct configuration).
When you create the new template, it should have a bit of sample code for web forms that should get you started.
Before you do that, however, here are some notes:
I think you actually can use user controls in MVC. If you wrap that user control in a macro, I think Umbraco is smart enough to use it in MVC (there are some limitations related to postbacks).
Are you sure you actually need user controls? Why not user partial views in MVC?
You can make just as complicated sites in MVC as you could in web forms. Here's an example: https://nvisioncenters.com/
I post in forum a question about your post quoted above. (https://our.umbraco.org/forum/templates-partial-views-and-macros/77062-partial-views-with-parameters).
Could you help-me? I believe that will help this member too.
Switching from MVC to Webforms in Umbraco 7.4.2
Hello everyone,
I have been using Umbraco for a few years and have always used Webforms. After avoiding Umbraco 7 for a while, I decided to move with the times and use it for a new website I am building. Umbraco 7.4.2 was the latest release and when I installed it, the automatic rendering engine was MVC. I struggled to get it switched to Webforms so I stuck with it. Now I'm occurring issues because I need to use usercontrols but this obviously requires Webforms.
Can anyone give me some advice as to what I need to do to switch to Webforms?
I have already changed the rendering engine to Webforms in the umbracoSettings file, I just need some help changing the code on my templates to work with Webforms.
This is the code for my masterpage:
I'm pretty comfortable with Webforms so I know how to change my Macro code, it's mostly just the code at the very top that inherits stuff?
Any help would be greatly appreciated.
Thank you, Jedd
I don't think you can convert an Umbraco template between MVC/web forms. What you can do is create a new template (use a different name, or issues may arise) and it should be a web forms template now that you've modified the configuration (assuming you've modified the correct configuration).
When you create the new template, it should have a bit of sample code for web forms that should get you started.
Before you do that, however, here are some notes:
Here is some documentation that may help you:
Hi Nicholas,
Thank you very much for the information. I'll look through the links you supplied and see which rendering engine I prefer.
Thanks again, Jedd
Just note that forms in usercontrols will not work, but yes, other than that you can wrap usercontrols in macros.
I've also blogged about converting from a Webforms form to MVC form here: https://umbraco.com/follow-us/blog-archive/2013/7/14/moving-from-webforms-to-mvc/
Sebastiaan, have a nice day (or night??)!!
I post in forum a question about your post quoted above. (https://our.umbraco.org/forum/templates-partial-views-and-macros/77062-partial-views-with-parameters).
Could you help-me? I believe that will help this member too.
Thanks!!!
is working on a reply...