CD..
CD..

Reputation: 74096

Using webforms views with razor layout

As we all know combining Razor and WebForms view engines is possible.

But is there any way I can use a WebForm view with a Razor layout?

UPDATE

just read Scott's post:

Upvotes: 1

Views: 2302

Answers (2)

Buildstarted
Buildstarted

Reputation: 26689

Telerik has a WebForms to Razor converter they made available recently.

https://github.com/telerik/razor-converter

I'm not sure what you want to do exactly but this might help you out.

Upvotes: 4

marcind
marcind

Reputation: 53183

There is no direct way hook up a WebForm view to use a Razor layout because the way the page gets rendered in both cases is quite different. The closest you can get is the approach described here: http://www.eworldui.net/blog/post/2011/01/07/Using-Razor-Pages-with-WebForms-Master-Pages.aspx (the post describes razor views with webforms master pages but you should be able to flip the view engines around).

However, the above technique has limitations and in the long-term it would be best if you either duplicated your master/layouts in both technologies or used a single view technology.

Upvotes: 4

Related Questions