Does umbraco 6.1.4 supports PURE MVC implementation - asp.net

Currently I am using umbraco 4.7.1 and planning to upgrade to version 6. But I will only go ahead it it allows PURE MVC approach. Here what I mean is I DON'T want to use any of ASP.NET like master page for templates. Everything should be in MVC

You can create a site in Umbraco 6 using just MVC including layout pages and all the other MVC bits, i.e. not master pages.
The administration section of Umbraco isn't MVC though, but that just works as usual. I havn't tried to add any MVC admin sections myself yet.
I'm building a pure MVC site in Umbraco 6, it's my first MVC site but it's all pretty much like the MVC book says.
When I create views etc. in Visual Studio, sub folders don't work well in the Umbraco admin section, it doesn't do sub folders very well. Also you have to set up your own version of the application start, which is no real problem but apart from that it's all sweet.

Currently I use Umbraco 6.1.3 and master pages are there. You can use old ASP.NET approach or MVC approach.

Related

ASP.Net Razor Identity

I am almost new to ASP.Net razor pages. Just one problem
I created a Visual studio project recently but I cant seem to find the pages
for Identity (Login, Create account etc)
Can someone pls tell me where they went or whatever.
I would really appriciate it.
If this is a .NET core or .NET 5/6 project then the Razor pages for Identity are in the DLL.
If you wish to customise these pages then you have to scaffold the Identity UI pages. This MS documentation should provide the steps to do this: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-6.0&tabs=visual-studio

Design a CMS site using ASP.NET MVC 5

I'm building a site which mainly has articles and I'm using ASP.NET MVC 5 framework. I want to have an admin page where I can add, edit these article content.
I'm having a problem with designing the structure of this project.
I'm thinking of having a controller class called 'adminController', where I handle all the requests related to content management.
Is that approach conceptually correct in ASP.NET MVC? Because If this was an ASP web forms project, I would simply have two different projects called Public and Admin in a single solution.
I'm quite new to ASP.NET MVC framework and I'd appreciate any help.
You can do 2 separate projects and can do one.
Since ASP.NET MVC 4 whe have Areas and i suggest you to use it if you want structure your project and separate admin logic from public.
Here is a tutorial that you can check that explain whar areas is and how you can work with them.

Using umbraco 7.x for webform projects

Is it possible or is it suitable to use umbraco 7.x for webform projects?
I'm a beginner in ASP.NET MVC and I'm learning about it, now.
Now I get a website project that I should do it immediately.
I just can do project with ASP.NET Webform, but I'll immigrate from Webform to MVC in the future.I want to have less problems when I decide to immigrate to MVC.Then I want to use Umbraco 7.x for my project in order to my plan.
Now, my question:
Is it possible or is it suitable to use umbraco 7.x for webform projects?
Short answer is yes, you can mix MVC and Webforms within an Umbraco 7 project. The rendering engine is determined by the template.
If an MVC template is found then it will use MVC as the rendering engine, otherwise it will look for a .master template (in the masterpages folder) and if it finds one it will use Webforms

Migrating from ASP.NET WebForms to ASP.NET MVC

I'm developing a web application for a company which I work for. My team started working on the app few months ago and the decision was to build it with ASP.NET WebForms. Now we've quite a lot of the code developed and we're wondering if ASP.NET WebForms was a good choice. Maybe we should migrate. Ok, but what's the first step? We don't want to rewrite everything from scratch. We'd like to add a new stuff in MVC and rewrite the old part in the future (gradually). Is it possible to add somehow ASP.NET MVC application to current WebForms one? Can they live together?
Asp.net webforms and MVC can live happily together. You will add some includes and directores and add a route which will cause your webforms pages to be ignored. All explained here:
http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc
Mixing MVC with webforms is not that all hard. Basically, you want to ignore any exisiting .aspx routes in your global.asax, and then add routes for new pages that you want to build using MVC.
See this article for more details.

Hybrid WebForms/ASP.NET MVC [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
ASP.NET MVC alongside Web Forms in the same web app?
I am kinda new to .NET applications, I have a web forms application that I am working on and I am about to start the development of new pages, I am trying to make the new pages with the ASP.NET MVC, but I am not beeing able to make the pages hit the controllers. First i added the library references added the routes on the global.asax but not sure what else is missing, can someone help me out?
thx.
Reading between the lines I gather you are trying to add MVC pages to your existing ASP.NET Webforms Webapplication?
If that is the case then you probably need some MVC specific config. settings. Easiest way is to create a new MVC web app and then merge the config settings.
Furthermore if you are doing a hybrid project I'd recommend giving Scott Hanselmann's post on the topic a read.
There's a more step-by-step description of adding MVC to a WebForms Application at these links:
Integrating ASP.Net MVC Into An Existing ASP.Net Web Application
Mixing ASP.NET Webforms and ASP.NET MVC
You might also want to add the ProjectTypeGuid to the project file with a text editor ({603c0e0b-db56-11dc-be95-000d561079b0} is used to designate to Visual Studio to use the MVC extensions.)
<ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
The links above also don't fully cover the system.webserver area of web.config that needs to be configured.
Scott Hanselman released a "totally unsupported" Nuget package that adds MVC 3 features to an existing Web Forms project. It also works on my PC (ha ha) and I've used it on several projects.
http://nuget.org/List/Packages/AddMvc3ToWebForms
He blogged about it here:
http://www.hanselman.com/blog/CreatingANuGetPackageIn7EasyStepsPlusUsingNuGetToIntegrateASPNETMVC3IntoExistingWebFormsApplications.aspx
One newb tip: this package will configure your MVC routes in /App_Start/RegisterMvc3Routes.cs
I've spent a lot of time over the past few months on this. Here are my observations.
The good/easy
- Getting Webforms to call into MVC controllers
- It was remarkably easy to stand up a new MVC3 project and drop Webforms pages into it.
- I was able to move my <pages><controls></controls></pages> section into the /pages directory in a new web.config there
The dirty/difficult
Regarding the GUID
Please note that the GUID has to be added at the front of the line for some reason... everytime I tried it failed. Until I stumbled on a post that insisted it be the before the others.
also I don't know what the difference is but I have a different GUID working... {E53F8FEA-EAE0-44A6-8774-FFD645390401}
getting the landing page to be Webforms caused ALL kinds of snags.
getting jQuery intellisense to play nicely with T4MVC
this is what I did to address that
#if (System.Diagnostics.Debugger.IsAttached)
{
<script src="../../Scripts/Mvc3/jquery-1.7-vsdoc.js" type="text/javascript"></script> #* intellisense! *#
#Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_1_7_js)
#Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_unobtrusive_ajax_js)
}
else
{
#Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_1_7_min_js)
#Html.RelativeJavascript(Links.Scripts.Mvc3.jquery_unobtrusive_ajax_min_js)
}
Recommendations:
Use T4MVC in ALL cases even if you are pure webforms. The elimination of magic strings for static content (.js,.css, images, specifying templates) is outstanding.
and if you have any part of your build process compiling views then you get compile-time safety on any of those links.

Resources