I have a masterpage which is generating markup in the codebehind file.
I want to refactor this so that the majority of the markup is in the masterpage rather than codebehind. My research suggests I need to use Razor but I'm not familiar enough with C# to implement this.
Can anyone make any recommendations? Here is an example of my code:
What version of Umbraco are using ? MVC master templates have been supported since v6 and are the recommended way to go. In future versions (V8?) webforms are not going to be supported anymore. But I could be wrong about that.
Refactoring a template
I have a masterpage which is generating markup in the codebehind file.
I want to refactor this so that the majority of the markup is in the masterpage rather than codebehind. My research suggests I need to use Razor but I'm not familiar enough with C# to implement this.
Can anyone make any recommendations? Here is an example of my code:
And this is the mark up in the masterpage:
Any advice is greatly appreciated!
Hi Burgi,
What version of Umbraco are using ? MVC master templates have been supported since v6 and are the recommended way to go. In future versions (V8?) webforms are not going to be supported anymore. But I could be wrong about that.
Dave
Hi Dave
We are using 6.2.2, it is an inherited site which needs a lot of remedial work doing to it.
Burgi
Hi Burgi,
You can have MVC templates and web forms views side by side.
Here is a guide on how to migrate from webforms to mvc in umbraco : https://umbraco.com/blog/moving-from-webforms-to-mvc/
Here you can find some more info on how have them side by side : https://our.umbraco.org/forum/templating/templates-and-document-types/41492-Mixing-Web-Forms-and-Razor-Templates-in-the-same-Umbraco-instance
dave
is working on a reply...