MVC Scaffolding is definitely cool. I created a custom scaffolder and custom template to create a Javascript test using YUI-Test.
What do I do to make this global -- available in any Visual Studio solution?
Many thanks.
Steven Sanderson has the answer.
http://blog.stevensanderson.com/2011/04/07/mvcscaffolding-creating-custom-scaffolders/
Related
Up until now I had been using MVC3 for my apps but with the new update of Visual Studio 2012 I got MVC4. I migrated a few of my apps and now they are broken.
I noticed that the new project template for an Internet application creates a ~/Content/themes/base folder.
And yet, up until now I had been accustomed to use the App_Themes folder for that. In fact, with VS.2013 you can use "Add ASP.NET FOlder | Themes".
So I am now confused with MVC4, has It deprecated the App_Themes folder (which seems more appropriate to me than ~/Content) ? or is there a significant difference?
App_Theme come from ASP.NET Platform and one goal of mvc is get a clean html code
One of the things that ASP.NET MVC is missing is the ability to
easily implement Themes. The older, more mature standard ASP.NET
framework includes theme support via the App_Themes folder; however
limited it can be, it’s still more than ASP.NET MVC currently has.
Well, at least until I wrote this little custom ViewEngine and
ControllerBase class to help out and allow us to very easily implement
Themes within our ASP.NET MVC applications
take a look this helpful article this link
Aside from T4MVC, does anyone use MvcContrib for MVC3 projects? We've decided to incorporate a prototype project that was built in MVC2 last year. It mainly uses the paging and sorting namespaces from MvcContrib, but also some fluent html helpers.
We want to upgrade the project to MVC3 and I am wondering if we should also try to remove some of the MvcContrib dependencies. Reasons to keep? Reasons to remove?
Yes, I use it in my projects. I use the Grid and the TestHelper extensively.
I am using TestHelper also, very useful and well written!
MvcContrib's strongly typed RedirectToAction gives you compile time errors if you delete or rename an action that you redirect to. With normal redirects, you're stuck with magic strings for action names, and as such the risk of overlooking a breaking change in your application.
The ModelStateToTempData attribute is also helpful as it lets you retain modelstate while you redirect from a update POST action back to the form page instead of returning a view directly from the update action (which is a bad practice).
I am starting a project with Sitecore, I have looked for different possibilities. I have some experience with MVC but I don't understand why you want to combine this with Sitecore (6.4).
What are the benefits? Are there any examples of the implementation of (the code of) this (not the configuration on: http://sdn.sitecore.net/upload/sitecore6/64/integrating%20an%20asp.net%20mvc%20web%20application%20in%20sitecore%20cms-usletter.pdf)?
Or why shouldn't I use MVC with Sitecore?
So when should I use Sitecore 6.4 with MVC3 and when not? And are there any (code)examples?
Thanks in advance!
I've successfully implemented my own MVP implementation using Sitecore. MVP is a bit more forgiving than MVC, and can easily be integrated into web forms based applications. I used T4 templates to generate Models directly from Sitecore templates using the built-in webservices which worked really well.
Sitecore doesn't support MVC yet (in the recommended release), and trying to make it work is probably not worth the effort. I believe they are working on a version that supports MVC properly, which may be the link you provided. However it's probably also very new and there is a lot of functionality in the old version that relies on web forms. I'd like to see it working under MVC in an official capacity for a few more iterations.
Implementing patterns such as MVC and MVP are all about separating concerns and making your presentation layer unit testable. It also encourages more elegant design.
Just reading the doc it looks like this is a guide for running Sitecore in parallel with MVC. I can't see anything about new rendering mechanisms for Sitecore, which would make templating difficult in anything other than web forms. It would however allow you to use the Sitecore API to build your own templates via MVC Views, but you would loose the inline editing functionality that you get out-of-the-box with web forms.
Using mvp is probably the simplest way to go. I wrote a blog post about it here.
However, we have used MVC3 with Razor before and it worked very well. The only issue is you lose the ability to use Page edit mode as you have to do some hacking of sitecore to get it to work. I'm contemplating writing a blog post about it if people are interested.
Just to follow up.. MVC is now supported in 6.6, which will be released on November 5th 2012. We just saw a demo from John West at the Sitecore Symposium and it looks like a great framework. One of the best things about it is that you can use MVC side-by-side with Web Forms. You don't have to make an all-in bet for MVC, you can just slowly migrate or build new components in MVC, while still running Web Forms throughout your site.
Does anyone have any recommendations about using a .ascx file (user control) versus a .vbhtml/.cshtml (razor) for custom templates? It would appear from my limited interaction that they are completely interchangeable.
Is it purely a matter of comfort/experience or are there pros and cons to each method?
Thanks
Yes, they are interchangeable. But if your main application uses Razor I would recommend you using Razor for those templates. Unless you have some legacy code from some older ASP.NET MVC 2 application that you want to reuse. For all new views I recommend Razor.
I want to separate concerns here. Create and embed all the UI logic for the Custom XML designer, object model, validations etc in to a separate assembly. Then the Package framework should only register the designer information and ask for a UI Service and everything works magically.
This way I don't need to play with the Package framework (Visual Studio Package) assembly, when I need to modify the UI designer.
This question also applies to anything where you have to separate the UI logic from the Skeleton framework that loads it up, like a plugin.
I have several choices a ServiceProvider model, a plugin model or may be other.
Any samples, suggestions for patterns, links are welcome.
Update 1: What I am looking for is a thought such as - "Does Prism (Composite WPF) fit the bill? Has anyone worked on a project/application which does the separation of concerns just like I mentioned above? etc"
(I am still looking out for answers)
I've created a VSPackage that loads an editor. The Editor sits in a separate assembly and implements an interface that I defined. The VSPackage works with the interface, so any changes I make to the editor (and its assembly) does not affect the VSPackage as long as I don't change the interface.
What you're asking about seams very much like the separation of concerns that the MVC pattern tries to enforce.
ASP.NET MVC is already out there with a preview 5.
It's mainly for web but I think they are planning on using it also for WinForms, but I'm not sure.
I prefer the Model View Presenter pattern