We are currently upgrading an existing site from MVC 3 to MVC 4 and so far we have encountered these two issues with the razor views : enter link description here and
enter link description here
our main interest in MVC 4 is web api so razor takes a back seat, is there a way to configure MVC 4 to use Razor 1, my question is not to tackle a specific error configuring this but: is it possible at all?
I believe that you should be able to register the original Razor View Engine in the Global.asax.cs at startup... And remove the Razor 2 View Engine...
Related
When you add Identity to your ASP.NET Core applications, you can scaffold its Razor pages.
I am looking for a way to extract my views from a referenced RCL just like Identity.
I mean I want to create Area and related files (cshtml) to help developers to customize it (not a specific UI as you see in the above pic).
Do there exist any command-line tools to a way to extract Razor pages (.cshtml)?
I checked inside of a Razor class library with dotpeek there is no HTML resource, everything is class.
Any idea?
I'm probably just missing a simple trick here, but I created the Identity framework in an ASP.NET Core project, created my own fields with my own classes, ran migrations, then once confirmed it was all working with the Default UI. It was working perfectly so went to customize the Identity UI so I could better control specific pages. Trouble was, thought I'd be adventurous and select every page to customize... yes dumb I know.. Now I've got some 80 pages or something that I no longer want.
I really only want to scaffold the registration and manage data pages, if I ran the Scaffolding again will that simply create new pages or fail because the pages already exist, or will it remove any pages that I don't select? I'm loathed to try it for fear of breaking something.
Perhaps it's down to manually deleting the pages I don't want, but will that cause issues with those pages that I haven't selected to customize. Seems great there's a scaffolding option to create the pages, but removing them... it's not so obvious...
For removing unwanted Identity Pages, you could delete them directly from your solution.
For Identity Razor page, if you add scaffold pages or manually create the razor pages with the corresponding name in Identity/Pages/Account, they will replace default Identity Razor page implementation. If there is no razor pages or you delete them, it will reuse default razor page from Razor library.
In my simple ASP.NET application with MVC I'm trying use ViewBag.
In my view:
#{
ViewBag.Title = "SomeSampleText";
}
works.
But if I want to set ViewBag.Message = "SomeText" in controller it's null and after this in view it's also null.
Anyway InteliSence like #ViewBag or #model also not works.
It was null in View. I thougth the cause is missing some references, but it was spelling mistake in controller.
It's works but still I've issue with "red" #ViewBag and #model and missing InteliSence. It's not working also with all asp TagHelpers (I've proper dependencies and they work).
I want to add I created project from empty Asp.NET core template, not from Web Application or MVC templates.
How do I add existing view pages to Piranha CMS. All searches refer to existing models which I have none in my solution.
You have to add the pages through the Manager interface into the database. Pirhana wont "see" your MVC Views automagically.
Trying to get Umbraco working with MVC/Razor. Everything is working ok except that the backend is showing empty templates. Is there any way to get Umbraco to allow editing the Razor partial views in the Templates folder in the Settings section?
turns out we just needed to wait a bit after changing the defaultRenderingEngine tag