Mixing WebForms and MVC: What should I do with the MasterPage?

In ASP. NET MVC the master page should derive from System.Web.Mvc. ViewMasterPage while in classic WebForms from System.Web.UI.

MasterPage If in MVC you use the latter you won't have access to any helpers. Although you could use ViewMasterPage in classic webforms because it derives from MasterPage (once again you won't have access to helpers in the web forms application but who cares) So to answer your question, yes, you could have a common master page assuming it derives from ViewMasterPage This being said you probably won't be able to make this work as in an MVC master page you would use HTML helpers to render partial views like Html. RenderPartial which doesn't make much sense in a classic WebForms application and vice versa in a classic WebForms application you would probably be using some server side controls like asp:xxx runat="server or have a single form tag (again with runat="server ) polluted with ViewState, etc... which hardly makes any sense in MVC.So my recommendation would be not to do like this.

In ASP. NET MVC the master page should derive from System.Web.Mvc. ViewMasterPage while in classic WebForms from System.Web.UI.MasterPage.

If in MVC you use the latter you won't have access to any helpers. Although you could use ViewMasterPage in classic webforms because it derives from MasterPage (once again you won't have access to helpers in the web forms application but who cares). So to answer your question, yes, you could have a common master page assuming it derives from ViewMasterPage.

This being said you probably won't be able to make this work as in an MVC master page you would use HTML helpers to render partial views like Html. RenderPartial which doesn't make much sense in a classic WebForms application and vice versa in a classic WebForms application you would probably be using some server side controls like or have a single form tag (again with runat="server") polluted with ViewState, etc... which hardly makes any sense in MVC. So my recommendation would be not to do like this.

(It's no big deal, since it do not change often) – Eduardo Molteni Aug 26 '10 at 18:23 Yes, this is my recommendation. There are cases where duplication is better rather than trying to much reuse and end up with a clone (the nature has created different species and trying to mix them could lead to unexpected results :-)). – Darin Dimitrov Aug 26 '10 at 18:27 Agree with you.

Thanks! – Eduardo Molteni Aug 26 '10 at 18:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions