Can ASP.net MVC 2 Project and CMS can be Combined together - asp.net-mvc

I have developed project using Asp.net MVC 2.Now the content part of My site i don't want to build a Cms for that So my question is can i used any existing CMS developed in MVC2 so that The content part will be taken care of by the CMS
and Application part by developed project by me.
I have used CMS like Silverstripe which is quite easy which also provides ORM to develop application on their Sapphire engine which but developed in PHP.
If it is Combined then when writing Code i will write like this
[This just Sample Imaginary Code.I just want CMS to be easy]
<logo><Pick_up_from_CMS ID=logo></logo>
<menu><Pick_up_from_CMS ID=menu></menu>
<header><Pick_up_from_CMS ID=header></header>
<body>
<Pick_up_from_CMS ID=body>
<MY_Application_Logic ID=Logic1><!--This May be my Registration or Search form> -->
</body>
<footer><Pick_up_from_CMS ID=footer></footer>

It is possible, yes.
It won't be easy though. A lot of the Content Management Systems out there rely on their own set of ASP.NET WebForms user controls to provide content functionality.
If you're going to integrate a ASP.NET WebForms CMS with ASP.NET MVC 2, you're going to have to do your integration at the API level (assuming the CMS has an API).
That will allow you to retreive and insert your content in your controller without having to use any WebForms User Controls.

Related

The right time to use razor pages vs mvc

I want to build an ecommerce website similar to amazon but the major difference is that users can register as companies and also register their own products within the website. I understand that mvc and razor web pages can be used side by side; I started a web application with razor web pages and it was stupidly easy to get up and running but now that I'm slightly further down the road (want to save users with different levels of permissions.) I beleive I may have to Transition my project
I've been reading some of the novel that is the microsoft documentation in addition to 3 other stack overflow links while researching.
Why is Razor Pages the recommended approach to create a Web UI in Asp.net Core 2.0?
ASP.NET Core 2.0 Razor pages vs Full MVC Core
What is difference between View and Page in Asp.net core 2?
I was just hoping to get some good input on when is the right time to use a razor page. because as I read more stuff it seems like I need to go undo some stuff and transition to mvc.

Migrating a webfrom asp.net appllication to MVC

I have been working on a CMS project based on asp.net webforms. It follows simple multitier architecture and contains a single aspx page where the usercontrols (ascx) in the form of modules are loaded dynamically.
Now a lot of clients are demanding it in MVC. I m wondering if it is feasible to seamlessly convert it into MVC. Is the hype just because MVC is the new paradigm for dot not or is it because it does yield substantial benefits?
What is the easiest way to migrate from WebForms to MVC?
You can always convert your existing ASP.NET web application project to include MVC and make it as a hybrid application. Scott Hanselman wrote a simple post to demonstrate how to do that.
If you are trying to add MVC to existing ASP.NET web application, Check out this link. I have scribbled a useful tip there to bring the MVC specific Context menu ( Add Controller/Add View) in the solution explorer.
The below statement is purely personal. (of course both has it's own pros and cons)
Personally If i start a new project, i will choose MVC over webforms. because i tasted it. It is addictive. :) I think My MVC projects are much cleaner than webforms ones.

Microsoft ASP .NET Web API, MVC 4 and SPA Architecture

Microsoft recently released MVC 4 Beta, which has these new very nice features like Web API and SPA. And as always Microsoft's demos do not demonstrate best practices from software design prospective. For example, using DbController which is tightly coupled to EF.
It seems for me that SPA and Web API go hand-by-hand in modern ASP .NET app.
I would like to hear any suggestions about structuring MVC 4-based solution, which is going to apply these new technologies like Web API and SPA.
For example, is it a good practice to separate Web API project with it's own controllers out of base MVC4 project or not. How to deal with SPA and not to use DbController in order to keep data persistence separately? What's going to be a main role of regular MVC4 app and especially Razor views?
Any other thoughts or suggestions are highly appreciated.
On separation of MVC4 + Web API: imho (as always) it depends on your concrete project.
Regarding EF: you should definitely not return EF Entities but return your own DTOs instead.
The role of MVC razor views could be rendering partial views you dynamically load from the client. You also could do some stuff like conditional loading of CSS / JS etc. for the Index page being loaded initially.
I think it's a good idea to keep the API in a separate web site project from your SPA/web site, as you can run in to problems with greedy routes.
Definitely keep your data access separate and loosely coupled.

HMVC reference architecture in .net

We are about to implement a large web forms application to asp.net mvc3. I just read about heirarchical MVC or HMVC. I found it to be a good concept. Are there any frameworks which already supports the same?
The application is majorly a intranet with a complicated UI. We are planning to have UI like Outlook webmail like interface. Also wanted feedback on whether its good to go with MVC or silverlight can be a point of consideration?
For your question about HMVC, I believe ASP.NET MVC does have HMVC since v2.0 in the form of Areas.
Couple that with T4MVC and calling Action.PartialX() methods and you've got yourself the next buzz-word HMVC.

ASP.NET MVC & Expression XAML - How do I integrate?

Some Background:
ASP.net MVC is primarly a paradigm shift in the way you structure and develop ASP.NET applications. Shifting from a "code behind" type of mentality to more of a standard MVC Ruby on Rails like mentality. I applaud it's efforts as a simlifying tool towards unit testing ease and seperation of code (although the html inline code could be debatable).
Expression and XAML is a way to describe the presentation layer that can be simple for designers.
The question is:
If we are to use ASP.NET MVC in developing our next website how does the design team that uses Expression and XAML supposed to create (V)iews or integrate into the development flow?
More specifically can Expression users still operate in an ASP.NET MVC world?
Note that the pages in Expression's model use a code behind paradigm as well.
It is a hack, but you can use XAML to render static images in ASP.NET MVC. Check out my post XAML Meets ASP.NET MVC - Serverside Image Rendering - that shows how to render XAML and WPF controls as an image in ASP.NET MVC
http://amazedsaint.blogspot.com/2010/07/xaml-meets-aspnet-mvc-create-databound.html
There is also the MvcXaml project that is a View Engine that allows for images to be dynamically generated based on a XAML view.
http://mvcxaml.codeplex.com
I will try to answer this, making several assumptions that may be wrong.
ASP.Net MVC is a web technology and XAML is a desktop one. You can use XAML inside Internet Explorer, but it's basically a hack, it works best for desktop or silverlight applications.
If you want a paradigm similar to MVC for the desktop, you should try the M-V-VM pattern, who is more appropriate to WPF and XAML.
With M-V-VM you can create views almost code-behind free.
A great intro to M-V-VM is this video by Jason Dolinger
If you are making a website using MVC and you are trying to integrate the design team, you should let them create the HTML+CSS views of your site, while the developers create the controllers and the models.
Please comment in this answer if I have misinterpreted the question.
I'm currently banging my head on these terms. However, maybe this silverlight-as-a-view-in-aspnet-mvc article will help? You've asked about XAML, and I thing this is what Silverlight uses...

Resources