reactjs - Razor Pages and Razor Views -


is idea mix razor pages razor views in same asp.net core 2.0 app?

if understand correctly, benefit of using razor pages don't need controller actions. in app, have pages return react app. feel razor pages perfect because need in page link bundle.js file.

having said that, have few pages need controller , send view model.

so, idea have both pages , views or should stick 1 , not mix together?

read razor pages in docs , rick anderson(member of asp.core team) said here that:

you can mix controllers, views , razor pages. rp unit testable (using code-behind). it's question. see https://github.com/aspnet/mvc/issues/494#issuecomment-232534742 motivation.

so can mix. tiny issue, in opinion, read docs that:

note: layout in pages folder. pages other views (layouts, templates, partials) hierarchically, starting in same folder current page. means layout in pages folder can used razor page under pages folder.

which means cannot use same layouts, templates, partials both razor page , view out of box, without modifying asp conventions or writing custom solution use same layouts, templates, partials both razor page , view. otherwise mix them looks fine.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -