An additional bit of information for you is that from v4.10 onwards it is recommend that you use Partial View Macros (these are written in Razor also) rather than Razor Macros (these are for legacy use only)
How Umbraco did solve the combination of Razor macros inside the WebForms?
By using the existing Umbraco macro engine which previously rendered XSLT, Ruby or IronPython templates
Are there any known issues with this combination?
No, it is mature now, Razor Macro's were introduced in Umbraco v4.6 and superseded by Partial View Macros in v4.10
Are there any limitation of this combinations?
You cannot currently have a controller (child action) for a Partial View Macro, however you can generally work around this issue.
I was looking around to better understand Partial Views
Are there any information about the workaround for the Partial View Macro controllers?
I've found that my WebForm pages don't contain any ViewState. Is it still possible to use .Net User Control on WebForm pages where are used Razor Partial Views, so some features are written in Razor and another via .NET Controls?
One thing I would ask is why you might choose to use WebForms with Partial View Macros rather than using native MVC templates and Partial Views, is it because you have existing user controls?
The workaround for Macro Partial Views is to just have it render a @Html.Action, it is described at the end of this blog post.
For your WebForm template to have a View state, you just need to ensure that you have <form runat="server">in the template and ensure than any usercontrols are within that form. You can render Macro Partial Views within your WebForms templates where ever you want to.
I am integrating my old web forms user controls in Razor macro and getting error Error executing child request for handler 'Umbraco.Web.FormlessPage'. and This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.
Combining WebForms and Razor macros - deep dive
I'm quite new in Umbraco and I'm pleasantly surprised, that I can have webforms pages with Razor macros.
I'm looking for more deep details about this implementation.
Thx.
Hi Michal,
An additional bit of information for you is that from v4.10 onwards it is recommend that you use Partial View Macros (these are written in Razor also) rather than Razor Macros (these are for legacy use only)
By using the existing Umbraco macro engine which previously rendered XSLT, Ruby or IronPython templates
No, it is mature now, Razor Macro's were introduced in Umbraco v4.6 and superseded by Partial View Macros in v4.10
You cannot currently have a controller (child action) for a Partial View Macro, however you can generally work around this issue.
Jeavon
Thanks Jeavon for info!
I was looking around to better understand Partial Views
Are there any information about the workaround for the Partial View Macro controllers?
I've found that my WebForm pages don't contain any ViewState. Is it still possible to use .Net User Control on WebForm pages where are used Razor Partial Views, so some features are written in Razor and another via .NET Controls?
MN
Hi Michal,
One thing I would ask is why you might choose to use WebForms with Partial View Macros rather than using native MVC templates and Partial Views, is it because you have existing user controls?
The workaround for Macro Partial Views is to just have it render a @Html.Action, it is described at the end of this blog post.
For your WebForm template to have a View state, you just need to ensure that you have
<form runat="server">
in the template and ensure than any usercontrols are within that form. You can render Macro Partial Views within your WebForms templates where ever you want to.Jeavon
I am integrating my old web forms user controls in Razor macro and getting error Error executing child request for handler 'Umbraco.Web.FormlessPage'. and This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.
Hi Amna
What version of Umbraco are you using? And have you set the template mode to run webforms in the /config/umbracoSettings.config ?
/Jan
is working on a reply...