Pro ASP.NET MVC Framework (Expert's Voice in .NET)
All
Stack Overflow 30
This Year
Stack Overflow 4
This Month
Stack Overflow 1
I recomend you to read some book: http://www.amazon.com/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079. You need to use action parameters.
MVC itself is a design pattern. You can use several combinations of other design patterns in your application to suit your particular needs.
If you want a read an excellent book on ASP.NET MVC then I would recommend Steven Sanderson's book - http://www.amazon.co.uk/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079
Note: This book is available for MVC2 as well, but I have not read that one. This book uses several good concepts that will help you create a production ASP.NET MVC application including TDD, repository pattern etc
There is no magic that you are missing. The Microsoft 'unobtrusive validation' script can be used in any website that uses jquery and jquery validate. It is not tied to ASP.NET - as long as the HTML is the format that the unobtrusive script expects, then the script will work. This fiddle shows the unobtrusive script applied to a form not produced by ASP.NET.
The unobtrusive script has two main tasks:
As you may have read, the markup attributes that the unobtrusive script reads are as follows
so a input field might look like this
My personal opinion of the unobtrusive script is that it falls into the category of what Steve Sanderson calls 'demoware' in his MVC book. It does some nice stuff out of the box but it hobbles jquery validate which is much easier to use on its own. I tend to delete it when I start a new project.
I'm reading a great ASP.NET MVC book by Apress: http://www.amazon.com/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079
In Chapter 10, there is a section called "Implementing a Custom View Engine", which shows you step by step how to implement an XSLT view engine. Its actually pretty simple (wish I could post it, but don't want to violate copyright).
I highly recommend this book to anyone (I bought and downloaded the e-book on their web site), the author really explains things well. ... OTOH, I recommend you avoid those red books with the authors' mug shots on them... unless you like books that consist mainly of screen shots and code dumps, with little effort on explaining concepts clearly.
Had this problem when following the Pro ASP.NET MVC Framework book, added
to the routes in the global.asax.cs file and it works. See more here: serving favicon.
quoted varbatim from an accepted answer here on SO. makes sense to me:
Must ASP.NET MVC Controller Methods Return ActionResult?
see also:
http://www.bengtbe.com/blog/post/2009/07/01/Use-specific-return-types-in-your-ASPNET-MVC-action-methods.aspx
Steve Sanderson (author of Pro ASP.NET MVC Framework) has an interesting blog post on this issue. The gist of it is that the DataContext should be kept around per "unit of work", which basically correlates to a "request". I guess you could get away with shorter lifespans if you weren't modifying object and had no need to persist (update) any changes back to the DB.
You may also want to check out 'When should I dispose of a data context?' here on SO.
I asked a similar question yesterday. Maybe you want to check out Preserve data in .net mvc
following is the code copied from Steve Sanderson's book
I recommend getting a book on ASP.NET MVC and working through the examples in the book. Don't worry too much about the history of the MVC design pattern or it's 1979 roots at Xerox PARC. I wouldn't bother reading much more about the actual MVC pattern than this simple article from MSDN: Cutting Edge: ASP.NET Presentation Patterns
I recently finished Steve Sanderson's Pro ASP.NET MVC Framework and I can recommend it. It has a multiple chapter sample application that gets you started quickly with ASP.NET MVC and then 10 or so follow-up chapters that cover the relevant topics in depth (Controllers, Views, Security, etc). The book has a strong focus on unit testing and dependency injection and also covers basic object relational mapping with LINQ to SQL. There is also chapters that cover integrating jQuery with ASP.NET MVC and how you might utilize framework components (authorization, membership, roles, personalization, caching, etc) from traditional WebForms applications.
There are a number of positive reviews on Steve's Blog which is also a good source of additional ASP.NET information. Amazon.com has a couple of positive reviews on the book (I need to add mine when I get some free time). You can also preview some of the book over at Google Books.
Some of the other books that are available now or available shortly are:
Wrox: Beginning ASP.NET MVC 1.0 --- Both authors Keyvan Nayyeri and Simone Chiaretta are active ASP.NET MVC bloggers. There is a sample chapter on testing for download here. I've read that it should be available at the end of June 2009?
Manning: ASP.NET MVC in Action --- This book is by Ben Scheirman, Jeffrey Palermo and Jimmy Bogard. They all have interesting blogs that cover ASP.NET MVC related topics. If I heard correctly, this book should be out in August 2009. You can pre-order the book (MEAP = Manning Early Access Program) here and get access to the first 11 chapters (unedited or loosely edited I think). The CodeCampServer reference application that complements the book is pretty intense and covers using nHibernate (ORM), Castle Windsor (DI / IoC), DDD, unit, integration and regression testing.
Wrox: Professional ASP.NET MVC 1.0 --- This is the book that accompanies the NerdDinner sample application and reader that was made available a while back. It's authored by some pretty smart Microsoft guys: Rob Conery, Scott Guthrie, Scott Hanselmann and Phil Haaaaaaaaaaaaack who have the inside information on why certain decisions were made with the framework. Available now.
Packt: ASP.NET MVC 1.0 Quickly --- The author Maarten Balliauw has a pretty good blog that talks about various ASP.NET MVC issues including testing. Available now.
Sams: ASP.NET MVC Framework Unleashed --- Author Stephen Walther is responsible for a number of popular ASP.NET Unleashed books from the early 1.0 days of ASP.NET and now he is writing a book on ASP.NET MVC. You can check out his blog for sample content from the upcoming book and other ASP.NET MVC related posts. Amazon says this book will be available in July 2009.
Wrox: ASP.NET MVC Website Programming Problem Design Solution --- This appears to be a follow-up to the book Wrox: ASP.NET 2.0 Website Programming: Problem Design Solution and welcomes back author Marco Bellinaso and introduces two new authors to the project Nick Berardi and Al Katawazi. The sample application for the book is the Beerhouse CMS and is available for download on CodePlex. The book's website says that it will be released in June 2009.
Roy - You ask a good question.
In my experience, the best resource that addresses your question is Chapter 12 of Steven Sanderson's Pro ASP.NET MVC Framework book.
I'm eager to see others respond to this question too.