like the MVC Framework provided by MS to create folder structure?
You can use ASP.NET MVC to do MVP. Basically it's called MVVM: Model-View View-Model. Just add a ViewModel folder, add ViewModel classes, and bind your views to the ViewModels.
I am looking the same techie...
I found this:
http://dnnmvptemplate.codeplex.com/
Related
I have an entity framework model that I created in one app, and I'd like to import(?) it into a new asp.net app. How is this done?
If you use a, for exemple, a Class Libary project for to make your EF model you can to add this project to another with "Project Reference"
I like to keep my EF models in their own Class Library projects. Then you can just open the existing project in any new solution in which you want the model to be included.
I am trying to learn MVC. I want to automatically generate the required view code as and when I add a controller. This is possible if I select the option “Controller with read/write actions and views, using Entity Framework” . However I am not using Entity Framework. How can I achieve the similar behavior without using Entity Framework? And why it is unable to automatically generate the view when I don’t use Entity Framework?
Also, is there any good MVC3 tutorial that does not use Entity Framework (with code download available) ?
Reference
How do I configure ASP.net MVC to Scaffold using ADO.net dataservice?
Levergaing T4Scaffolding for WCF Web API
ASP.NET MVC 3 and NHibernate Scaffolding
Scaffold your ASP.NET MVC 3 project with the MvcScaffolding package
Once again LINQ to SQL or Entity Framework for new MVC 3 project
MVC Scaffolding for WCF Services
Create a Dropdown List for MVC3 using Entity Framework (.edmx Model) & Razor Views && Insert A Database Record to Multiple Tables
You might find some of what you're looking for in Steve Sanderson's MvcScaffolding package
Nuget
Install-Package MvcScaffolding
After installing (it will probably install some EF requirements) you could scaffold basic CRUD views for your model as follows assuming a model type MySweetModel
Scaffold Views MySweetModel
Please note this command will not create the controller class, but should create the following views under /Views/MySweetModel
_CreateOrEdit.cshtml
Create.cshtml
Delete.cshtml
Details.cshtml
Edit.cshtml
Index.cshtml
It looks like you might be able to override the default T4 templates, but I've never used MvcScaffolding outside the scope of EF. It's also possible someone has already done this for your persistence layer e.g. NHibernate or whatever you're using. I'd search a bit before implementing your own templates.
I am using ASP.NET MVC 2.0 and I want to transfer my ViewModel properties to business object. I can do this manually or use AutoMapper or use new method available in ASP.NET MVC 2.0. My question is that does anyone know the name of the new method which allows to copy the properties from one object to another?
Got it! But it is part of ASP.NET MVC Futures library! Sorry for the confusion.
ModelCopier.CopyModel(employeeViewModel, employee);
And here is the link:
http://weblogs.asp.net/rajbk/archive/2010/03/31/easy-way-to-update-models-in-your-asp-net-mvc-business-layer.aspx
How can I put the LINQ to SQL generated classes in a dedicated DAL project so that I can access it from various other projects in the same solution? I.e. so I can use one for Web, and one for Windows Forms?
Absolutely no problem - just create a "class library" project and create your DBML file (LINQ-to-SQL file) in there.
Now, from all your projects that need this particular Linq-to-SQL file, add a reference to that class library assembly, and use the classes - and you're done!
The Linq-to-SQL DBMX file and its associated classes are just pure C# business objects and methods - there's nothing web- or Winforms-specific about those - you can use those in Winforms, WPF, Web Forms, ASP.NET MVC - you name it.
Marc
As far as I know, ASP.NET MVC leverages a lot of the features of ASP.NET Web Forms, one of these services is how to get the Html response from the template .aspx file (the view). Can asp.net mvc leverages any other platform to generate html over template files (something like PHP for example)?
EDIT: There is NO use case for this, just curiosity!
Yes, it can! The aspx model is just one of the view template mechanisms. There are others - you can even write your own. The key here is IViewEngine, with WebFormViewEngine being the aspx/ascx provider. ASP.NET MVC In Action covers some of this in chapter 6 "Customizing & Extending the ASP.NET MVC Framework".
you can use other ViewEngines
Spark
NHaml