ASP.NET MVC的必备知识

时间:2022-09-11 10:32:10

After being frustrated in my attempts to learn the arcana that is ASP.NET, I decided to try ASP.NET MVC.

在我尝试学习ASP.NET的Arcana之后感到沮丧,我决定尝试使用ASP.NET MVC。

I have extensive experience with C# 2.0 doing just about everything (WinForms, Windows Services, remoting, ...) except ASP.NET . I've been writing PHP for even longer than I've been coding .NET. With all of this experience, I thought I was ready for ASP.NET MVC. I now see I'm learning the following simultaneously and having a bit of a hard time with it:

我对C#2.0有很多经验,除了ASP.NET之外几乎所有事情(WinForms,Windows服务,远程处理......)。我编写PHP的时间比编写.NET要长得多。凭借所有这些经验,我认为我已经为ASP.NET MVC做好了准备。我现在看到我正在同时学习以下内容并且有一点困难:

  • the MVC pattern in general
  • 一般的MVC模式
  • ASP.NET
  • ASP.NET
  • ASP.NET MVC
  • ASP.NET MVC
  • .NET 3.5.
  • .NET 3.5。

I'm currently about 1/2 way through the NerdDinner free book chapter. I don't feel completely lost but I do get the feeling that I'm not catching on to as much as I'd like to (due to the fact that I'm learning 4 things at once -- sometimes it's not clear which skills are from which abstraction layer).

我目前正在通过NerdDinner免费书籍章节的一半。我并没有感到完全失去,但我确实感觉到我没有像我想的那样追随(因为我正在同时学习4件事 - 有时候不清楚哪一件事技巧来自哪个抽象层)。

What prerequisite knowledge would you recommend for ASP.NET MVC? Any/all of those I listed above? Others? Or maybe I'm just slow and most people would be fine doing what I did.

您会为ASP.NET MVC推荐哪些先决条件知识?我上面列出的任何/所有人?其他?或者也许我只是很慢,大多数人会做我做的很好。

14 个解决方案

#1


16  

I have been an ASP.Net developer for just 3 years now. I got a project from a friend and decided to develop it using ASP.Net MVC to learn this new stuff. I must admit I felt lost in the beginning as well, but then I saw some very interesting articles on the ASP.Net/MVC site. At the bottom are 7 iterations which will give you a very detailed of what you are doing while you are doing it.

我已经成为ASP.Net开发人员仅仅3年了。我从朋友那里得到了一个项目,并决定使用ASP.Net MVC开发它来学习这些新东西。我必须承认我一开始也感到迷茫,但后来我在ASP.Net/MVC网站上看到了一些非常有趣的文章。在底部是7次迭代,它将为您提供非常详细的内容,当您这样做时。

I used the Products example they have there and applied sortof the same to my own project. After all the iterations, I now feel like I have a very good base to start learning the more advanced MVC implementations. (JQuery plugins/Ajax/...)

我使用了他们在那里的Products示例,并对我自己的项目应用了相同的sort。在所有迭代之后,我现在觉得我有一个很好的基础来开始学习更高级的MVC实现。 (JQuery插件/ Ajax / ...)

http://www.asp.net/learn/mvc/

http://www.asp.net/learn/mvc/

I think some basic understanding of ASP.Net is a base requirement. If you have that, you should be able to get through this with just a little bit of motivation.

我认为对ASP.Net的一些基本了解是一个基本要求。如果你有这个,你应该能够通过一点动力来解决这个问题。

#2


10  

"MVC pattern in general" - no need but useful. ASP.NET - also not necessary.

“MVC模式一般” - 没有必要但有用。 ASP.NET - 也没必要。

.NET 3.5 - yes. It will be your working tool, you should master it.

.NET 3.5 - 是的。这将是你的工作工具,你应该掌握它。

Very useful would be the understanding of multi-tier architecture since this time you will have to think first about how you organize your application, opposite to direct hacking with controls in WebForms.

非常有用的是对多层体系结构的理解,因为这次你必须首先考虑如何组织你的应用程序,而不是直接攻击WebForms中的控件。

Also you will not avoid knowledge of HTML/CSS, maybe JavaScript.

此外,您不会避免使用HTML / CSS,也许是JavaScript。

Just don't be scared. Do it one step at a time and you will get it. Just don't read too much. Practice it.

只是不要害怕。一步一步,你会得到它。只是不要读太多。练习吧。

Lots of highly useful tutorials are to be found here: ASP.NET MVC Tutorials

这里有很多非常有用的教程:ASP.NET MVC教程

Also read blogs from ASP.NET MVC "parents":

还阅读ASP.NET MVC“parent”中的博客:

http://haacked.com

http://haacked.com

http://weblogs.asp.net/scottgu/default.aspx

http://weblogs.asp.net/scottgu/default.aspx

http://www.hanselman.com/

http://www.hanselman.com/

http://stephenwalther.com/blog/Default.aspx

http://stephenwalther.com/blog/Default.aspx

#3


7  

I have a similar background. I have used .Net/C# since its inception, but all system related, no web experience. About 8 months ago, I decided that I wanted to learn about the web and decided that for me ASP.NET MVC seemed like the right way to go. I don't feel that my lack of ASP.NET experience was too much of a hindrance. I used the http://www.asp.net/mvc/ site as the center for my learning. All the videos are good, plus the tutorials and all the sample projects. I have downloaded most of them and have enough familiarity that when I can't figure something out I go to one of the downloaded projects with a similar requirement and look to see how it was coded. Knowing no web technology, I also ordered books on HTML, CSS, JAVA script, AJAX and Jquery. For me the best way to learn is to develop a project, so that it what I did. Most of the authors of the new MVC books also have blogs with lots of good information. When I started to learn about MVC, the MVC books hadn't been published yet, but I am sure there are some good ones out there by now or that will be available soon.

我有类似的背景。我从一开始就使用过.Net / C#,但所有系统都相关,没有网络体验。大约8个月前,我决定要了解网络并决定对我来说ASP.NET MVC似乎是正确的方法。我不认为我缺乏ASP.NET经验是一个太大的障碍。我使用http://www.asp.net/mvc/网站作为我学习的中心。所有视频都很好,加上教程和所有示例项目。我已经下载了大部分内容,并且有足够的熟悉度,当我无法解决问题时,我会转到其中一个具有类似要求的下载项目,并查看它是如何编码的。我不懂网络技术,还订购了关于HTML,CSS,JAVA脚本,AJAX和Jquery的书籍。对我来说,最好的学习方法是开发一个项目,这就是我所做的。新MVC书籍的大多数作者也有博客,有很多好的信息。当我开始学习MVC时,MVC书籍尚未发布,但我相信现在有一些好的或者即将推出。

I have enjoyed the new experience and have learned a lot, I think the new technology is great. Good Luck!

我很享受新的体验并学到了很多东西,我认为新技术很棒。祝你好运!

#4


4  

I think once one wraps one's head around the idea that MVC uses routing to direct requests straight to classes (which use a model for connections and a view for display) rather than showing "actual" pages, the concept of MVC in a web application really presents itself more clearly. With the 'difficulty of concept' out of the way, it's a lot easier to consider those attributes and make a decision whether MVC is suited to a particular application.

我认为,一旦人们开始关注MVC使用路由将请求直接引导到类(使用模型进行连接和显示视图)而不是显示“实际”页面的想法,那么Web应用程序中MVC的概念确实存在表现得更清楚。由于“概念难度”不在考虑范围内,因此考虑这些属性并决定MVC是否适合特定应用程序要容易得多。

edit -- having said that, if I were new to ASP.NET, I would probably tackle the forms version first and get a good understanding of events, postback, and the methodology of that system before going into MVC because ASP.NET MVC is really handled on top of that system.

编辑 - 说过,如果我是ASP.NET的新手,我可能会首先处理表单版本并在进入MVC之前很好地理解事件,回发和该系统的方法,因为ASP.NET MVC是真的处理在该系统之上。

edit 2 - I think I got voted down before finishing my edits :-(

编辑2 - 我想我在完成编辑之前已经投了票:-(

#5


4  

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

我建议您阅读一本关于ASP.NET MVC的书,并阅读本书中的示例。不要过分担心MVC设计模式的历史,或者它是1979年Xerox PARC的根源。我不打算阅读更多关于实际MVC模式的内容,而不是MSDN中的这篇简单文章:前沿:ASP.NET演示模式

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.

我最近完成了Steve Sanderson的Pro ASP.NET MVC框架,我可以推荐它。它有一个多章节示例应用程序,可以让您快速使用ASP.NET MVC,然后是10个左右的后续章节,深入介绍相关主题(控制器,视图,安全性等)。本书重点关注单元测试和依赖注入,还介绍了LINQ to SQL的基本对象关系映射。还有一些章节介绍了如何将jQuery与ASP.NET MVC集成,以及如何利用传统WebForms应用程序中的框架组件(授权,成员资格,角色,个性化,缓存等)。

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.

史蒂夫博客上有许多正面评论,这也是其他ASP.NET信息的良好来源。 Amazon.com对这本书有一些积极的评论(当我获得一些空闲时间时,我需要添加我的)。您还可以在Google图书上预览部分图书。


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?

Wrox:开始ASP.NET MVC 1.0 ---两位作者Keyvan Nayyeri和Simone Chiaretta都是活跃的ASP.NET MVC博主。这里有一个关于测试下载的示例章节。我读过它应该在2009年6月底上市吗?

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.

Manning:ASP.NET MVC in Action ---本书由Ben Scheirman,Jeffrey Palermo和Jimmy Bogard撰写。他们都有有趣的博客,涵盖ASP.NET MVC相关主题。如果我没有正确地听到,这本书应该在2009年8月出版。你可以在这里预订这本书(MEAP = Manning Early Access Program)并访问前11章(我认为未编辑或松散编辑)。 CodeCampServer参考应用程序是本书的补充,它涵盖了使用nHibernate(ORM),Castle Windsor(DI / IoC),DDD,单元,集成和回归测试。

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.

Wrox:专业的ASP.NET MVC 1.0 ---这是随后提供的NerdDinner示例应用程序和阅读器附带的书。它由一些非常聪明的微软人员撰写:Rob Conery,Scott Guthrie,Scott Hanselmann和Phil Haaaaaaaaaaaa,他们掌握了为什么用框架做出某些决定的内幕消息。现在有空。

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.

Packt:ASP.NET MVC 1.0快速---作者Maarten Balliauw有一个非常好的博客,讨论各种ASP.NET MVC问题,包括测试。现在有空。

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.

Sams:ASP.NET MVC框架释放---作者Stephen Walther负责ASP.NET早期1.0版的一些流行的ASP.NET Unleashed书籍,现在他正在写一本关于ASP.NET MVC的书。您可以查看他的博客,了解即将出版的书籍和其他ASP.NET MVC相关帖子中的示例内容。亚马逊称这本书将于2009年7月上市。

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.

Wrox:ASP.NET MVC网站编程问题设计解决方案---这似乎是本书Wrox:ASP.NET 2.0网站编程:问题设计解决方案的后续版本,欢迎回复作者Marco Bellinaso并介绍两位新作者项目Nick Berardi和Al Katawazi。本书的示例应用程序是Beerhouse CMS,可在CodePlex上下载。该书的网站称它将于2009年6月发布。

#6


3  

If you don't already know Webforms, then stick to learning just MVC right now so that you don't confuse yourself. Webforms is a useful thing to know, and since you know Winforms already, it shouldn't be too hard to learn afterward.

如果您还不了解Webforms,那么现在就坚持学习MVC,这样就不会让自己感到困惑。 Webforms是一个有用的东西,因为你已经了解Winforms,所以后来学习它不应该太难。

MVC and Webforms both work under ASP.NET, so a lot of things you'll learn while playing with MVC will carry over to Webforms.

MVC和Webforms都可以在ASP.NET下工作,因此在玩MVC时你将学到的很多东西都会转移到Webforms上。

#7


3  

This is a good introduction from Martin Fowler. He talks in detail about GUI Architectures.

这是Martin Fowler的一个很好的介绍。他详细讨论了GUI架构。

Start reading some material on the following topics and they will really help you gear yourself towards any MVC in general. Here are some topics that you can look up online:

开始阅读以下主题的一些材料,它们将真正帮助您适应任何MVC。以下是您可以在线查看的一些主题:

  • Routing.
  • 路由。
  • The MVC Pattern.
  • MVC模式。
  • Controllers and Actions.
  • 控制器和动作。
  • Mapping parameters.
  • 映射参数。
  • ActionResults.
  • ActionResults。
  • Error handling.
  • 错误处理。
  • Action filtering.
  • 动作过滤。
  • Passing data to a view.
  • 将数据传递给视图。
  • HTML Helpers.
  • HTML助手。
  • View rendering extensibility.
  • 查看呈现可扩展性。
  • Using jQuery with ASP.NET MVC.
  • 在ASP.NET MVC中使用jQuery。
  • Best practice tips for views, controllers, and models.
  • 视图,控制器和模型的最佳实践技巧。
  • MVC Anti-patterns.
  • MVC反模式。

#8


2  

It might help to approach Asp.Net MVC from a different angle: Read the Agile Web Development With Rails book, follow along (implement using Rails), and try to implement a project of similar scope to what's in that book in ASP.Net MVC.

从不同的角度来看待Asp.Net MVC可能会有所帮助:阅读Agile Web Development with Rails一书,跟随(使用Rails实现),并尝试实现一个类似于ASP.Net MVC中该书的内容的项目。

You'll pick up Rails quickly (a week or two of hacking around a couple of hours a night), and the explication of the conventions of Rails will guide you into a mindset that aligns fairly closely with the Asp.Net MVC way. It'll probably help you understand the motivations for MVC along the way, and you'll certainly have opinions about how things "should" work in Asp.net MVC.

你可以快速拿起Rails(一周或两周左右的黑客攻击),Rails惯例的解释将引导你进入一种与Asp.Net MVC方式非常接近的思维模式。它可能会帮助您了解MVC的动机,并且您肯定会对Asp.net MVC中的“应该”如何工作有所了解。

#9


2  

I would spend some time on ASP.NET first before learning ASP.NET MVC. Remember, ASP.NET MVC is based on ASP.NET. Some things from traditional ASP.NET won't be used with the MVC model (user controls, (ASCX and ASPX files)) but it is a good thing to still understand these. If you want to focus on MVC, first learn ASP.NET but do not spend time studying the common controls or databinding.

在学习ASP.NET MVC之前,我会先花一些时间在ASP.NET上。请记住,ASP.NET MVC基于ASP.NET。传统ASP.NET中的一些东西不会与MVC模型(用户控件,(ASCX和ASPX文件))一起使用,但仍然理解这些是一件好事。如果你想专注于MVC,首先要学习ASP.NET,但不要花时间研究常用控件或数据绑定。

The rest of ASP.NET is still useful (HttpModules, HttpHandlers, the web.config file, the membership provider, etc) when you're doing ASP.NET MVC, and I'd say likely a prerequisite to really using ASP.NET MVC well.

当你在做ASP.NET MVC时,ASP.NET的其余部分仍然有用(HttpModules,HttpHandlers,web.config文件,成员资格提供程序等),我想说可能是真正使用ASP.NET的先决条件MVC很好。

That said, there is a lot more work for ASP.NET out there than ASP.NET MVC. Some employers are looking for people who know MVC, but they are mainly doing that as they are looking for people who are passionate about learning new things. My concern with ASP.NET MVC is that I don't see how to integrate it with traditional ASP.NET applications. The reality is most jobs out there involve working with an existing codebase, not starting from scratch.

也就是说,除了ASP.NET MVC之外,ASP.NET还有很多工作要做。一些雇主正在寻找了解MVC的人,但他们主要是这样做,因为他们正在寻找热衷于学习新事物的人。我对ASP.NET MVC的关注是我没有看到如何将它与传统的ASP.NET应用程序集成。事实上,大多数工作涉及使用现有的代码库,而不是从头开始。

#10


2  

I'd been following ASP.Net MVC pretty much from the beginning, and I have to say, I love it. Combined with Unity (or another DI framework) it just flows nicely. I've always liked a certain separation of concerns principle anyhow, and favored ASP.Net over PHP (and classic ASP). I didn't always like the control pattern of ASP.Net though. MVC fits much better. And with Json() and PartialView() for return types interacting with jQuery.getJSON() and $("#mydiv").load() is very simplified on the server-side. It also works well when following SOLID Design principles...

我从一开始就一直在关注ASP.Net MVC,我不得不说,我喜欢它。结合Unity(或另一个DI框架),它只是很好地流动。无论如何,我总是喜欢某种关注点分离原则,并且比PHP(和经典ASP)更喜欢ASP.Net。我并不总是喜欢ASP.Net的控件模式。 MVC非常适合。使用Json()和PartialView()返回类型与jQuery.getJSON()和$(“#mydiv”)交互。在服务器端,load()非常简化。遵循SOLID设计原则时它也很有效......

It does help to have a solid understanding of HTML and JavaScript (AJAX, DHTML) for more interactive points. It also helps to think in terms of the MVC pattern, or not thinking about cluttering your controller and your data.

对于更多交互点,它有助于深入理解HTML和JavaScript(AJAX,DHTML)。它还有助于根据MVC模式进行思考,或者不考虑使控制器和数据混乱。

One thing I don't care as much for, is the lack of a built in skinning system, for multiple skins on a web-app. I've come around this, and having the source really helps. I would say as other have suggested, follow the blogs (and read back) of Phil Haack, Scott Guthrie, and Scott Hanselman. They all have vital information. Beyond this, as also mentioned, the demos on the ASP.Net MVC Website are very good.

我不太关心的一件事是缺少内置的皮肤系统,对于网络应用程序上的多个皮肤。我已经解决了这个问题,让源代码真正有用。我会像其他人所说的那样,跟随Phil Haack,Scott Guthrie和Scott Hanselman的博客(并回读)。他们都有重要的信息。除此之外,正如前面提到的,ASP.Net MVC网站上的演示非常好。

#11


1  

Apart from what others have recomended I would suggest the following two books:

除了别人的建议之外,我会建议以下两本书:

  • Spring in Action : It's not ASP.NET MVC, it's about Spring, but the foundations are similar and it's really well written.
  • Spring in Action:它不是ASP.NET MVC,它是关于Spring的,但它的基础是相似的,而且写得非常好。
  • Pro ASP.NET MVC 2 Framework : It explains the concepts in an easy to follow way, and it helps introduce DI into ASP.NET MVC.
  • Pro ASP.NET MVC 2框架:它以易于理解的方式解释概念,并有助于将DI引入ASP.NET MVC。

#12


0  

All previous post are so cool :) but i want to add my own view. Without some base of asp.net runtime mechanism you can't write a good app. This info you could get from dino esposito book(he has two books about asp.net 2.0 - basic and advanced level) in basic level - there is one chapter about processing incoming request - you could read only this chapter.

所有以前的帖子都很酷:)但我想添加自己的观点。没有一些asp.net运行时机制的基础,你不能写一个好的应用程序。您可以从基本级别的dino esposito书(他有两本关于asp.net 2.0的书籍 - 基础和高级水平)获得这些信息 - 有一章关于处理传入的请求 - 您只能阅读本章。

If you know what is httpapplication, httpruntime, request, response etc. just skip my answer.

如果您知道什么是httpapplication,httpruntime,请求,响应等,请跳过我的回答。

#13


0  

I know from my brief time with a Ruby on Rails job, coming back to ASP.NET and working with MVC it was easy to apply what I learned from RoR to ASP.NET MVC. Truthfully, ASP.NET MVC is actually just about the VC part and not much about the Model since ASP.NET doesn't have to be very REST based whereas RoR practically enforces it.

我从简短的时间开始知道Ruby on Rails的工作,回到ASP.NET并使用MVC,很容易将我从RoR学到的知识应用到ASP.NET MVC。说实话,ASP.NET MVC实际上只是关于VC的部分而不是模型,因为ASP.NET不必非常基于REST,而RoR实际上强制执行它。

The problem I find is trying to get people to learn correct conventions of MVC when they are first learning it by coming from ASP.NET itself. Like others have mentioned, it might be a good idea to learn a true MVC platform (in this case RoR) because trying to apply what you know about ASP.NET to a MVC architecture. A good place to start with RoR is http://railsforzombies.org/ It's also kind of fun and will give you the basics for what really goes where in the ideal REST MVC scenario. After that apply what you know to the MVC for ASP.NET.

我发现的问题是,当他们第一次从ASP.NET本身学习它时,试图让人们学习正确的MVC约定。像其他人提到的那样,学习真正的MVC平台(在本例中为RoR)可能是一个好主意,因为尝试将您对ASP.NET的了解应用于MVC架构。一个开始使用RoR的好地方是http://railsforzombies.org/它也很有趣,它将为您提供理想REST MVC场景中真正有用的基础知识。之后,将您所知道的内容应用于MVC for ASP.NET。

#14


0  

The very first and basic thing with ASP.Net MVC is the Routing concepts. LEarn this well first. You can also go throught System.Web.Routing Namespace on getting some more idea on this. Routing is just telling the IIS that is there is a request for a particular extension then redirect to this handler.

ASP.Net MVC的第一个基本要点是路由概念。先学会好。您还可以通过System.Web.Routing命名空间了解更多信息。路由只是告诉IIS,是否有特定扩展的请求,然后重定向到此处理程序。

The next thing would "Convention over configuration". For MVC you need to have a particular folder structure like Controller,Model and Views .Nothing more mystery here.

接下来的事情将是“约会过度配置”。对于MVC,您需要具有特定的文件夹结构,如Controller,Model和Views。这里没有更多的谜。

#1


16  

I have been an ASP.Net developer for just 3 years now. I got a project from a friend and decided to develop it using ASP.Net MVC to learn this new stuff. I must admit I felt lost in the beginning as well, but then I saw some very interesting articles on the ASP.Net/MVC site. At the bottom are 7 iterations which will give you a very detailed of what you are doing while you are doing it.

我已经成为ASP.Net开发人员仅仅3年了。我从朋友那里得到了一个项目,并决定使用ASP.Net MVC开发它来学习这些新东西。我必须承认我一开始也感到迷茫,但后来我在ASP.Net/MVC网站上看到了一些非常有趣的文章。在底部是7次迭代,它将为您提供非常详细的内容,当您这样做时。

I used the Products example they have there and applied sortof the same to my own project. After all the iterations, I now feel like I have a very good base to start learning the more advanced MVC implementations. (JQuery plugins/Ajax/...)

我使用了他们在那里的Products示例,并对我自己的项目应用了相同的sort。在所有迭代之后,我现在觉得我有一个很好的基础来开始学习更高级的MVC实现。 (JQuery插件/ Ajax / ...)

http://www.asp.net/learn/mvc/

http://www.asp.net/learn/mvc/

I think some basic understanding of ASP.Net is a base requirement. If you have that, you should be able to get through this with just a little bit of motivation.

我认为对ASP.Net的一些基本了解是一个基本要求。如果你有这个,你应该能够通过一点动力来解决这个问题。

#2


10  

"MVC pattern in general" - no need but useful. ASP.NET - also not necessary.

“MVC模式一般” - 没有必要但有用。 ASP.NET - 也没必要。

.NET 3.5 - yes. It will be your working tool, you should master it.

.NET 3.5 - 是的。这将是你的工作工具,你应该掌握它。

Very useful would be the understanding of multi-tier architecture since this time you will have to think first about how you organize your application, opposite to direct hacking with controls in WebForms.

非常有用的是对多层体系结构的理解,因为这次你必须首先考虑如何组织你的应用程序,而不是直接攻击WebForms中的控件。

Also you will not avoid knowledge of HTML/CSS, maybe JavaScript.

此外,您不会避免使用HTML / CSS,也许是JavaScript。

Just don't be scared. Do it one step at a time and you will get it. Just don't read too much. Practice it.

只是不要害怕。一步一步,你会得到它。只是不要读太多。练习吧。

Lots of highly useful tutorials are to be found here: ASP.NET MVC Tutorials

这里有很多非常有用的教程:ASP.NET MVC教程

Also read blogs from ASP.NET MVC "parents":

还阅读ASP.NET MVC“parent”中的博客:

http://haacked.com

http://haacked.com

http://weblogs.asp.net/scottgu/default.aspx

http://weblogs.asp.net/scottgu/default.aspx

http://www.hanselman.com/

http://www.hanselman.com/

http://stephenwalther.com/blog/Default.aspx

http://stephenwalther.com/blog/Default.aspx

#3


7  

I have a similar background. I have used .Net/C# since its inception, but all system related, no web experience. About 8 months ago, I decided that I wanted to learn about the web and decided that for me ASP.NET MVC seemed like the right way to go. I don't feel that my lack of ASP.NET experience was too much of a hindrance. I used the http://www.asp.net/mvc/ site as the center for my learning. All the videos are good, plus the tutorials and all the sample projects. I have downloaded most of them and have enough familiarity that when I can't figure something out I go to one of the downloaded projects with a similar requirement and look to see how it was coded. Knowing no web technology, I also ordered books on HTML, CSS, JAVA script, AJAX and Jquery. For me the best way to learn is to develop a project, so that it what I did. Most of the authors of the new MVC books also have blogs with lots of good information. When I started to learn about MVC, the MVC books hadn't been published yet, but I am sure there are some good ones out there by now or that will be available soon.

我有类似的背景。我从一开始就使用过.Net / C#,但所有系统都相关,没有网络体验。大约8个月前,我决定要了解网络并决定对我来说ASP.NET MVC似乎是正确的方法。我不认为我缺乏ASP.NET经验是一个太大的障碍。我使用http://www.asp.net/mvc/网站作为我学习的中心。所有视频都很好,加上教程和所有示例项目。我已经下载了大部分内容,并且有足够的熟悉度,当我无法解决问题时,我会转到其中一个具有类似要求的下载项目,并查看它是如何编码的。我不懂网络技术,还订购了关于HTML,CSS,JAVA脚本,AJAX和Jquery的书籍。对我来说,最好的学习方法是开发一个项目,这就是我所做的。新MVC书籍的大多数作者也有博客,有很多好的信息。当我开始学习MVC时,MVC书籍尚未发布,但我相信现在有一些好的或者即将推出。

I have enjoyed the new experience and have learned a lot, I think the new technology is great. Good Luck!

我很享受新的体验并学到了很多东西,我认为新技术很棒。祝你好运!

#4


4  

I think once one wraps one's head around the idea that MVC uses routing to direct requests straight to classes (which use a model for connections and a view for display) rather than showing "actual" pages, the concept of MVC in a web application really presents itself more clearly. With the 'difficulty of concept' out of the way, it's a lot easier to consider those attributes and make a decision whether MVC is suited to a particular application.

我认为,一旦人们开始关注MVC使用路由将请求直接引导到类(使用模型进行连接和显示视图)而不是显示“实际”页面的想法,那么Web应用程序中MVC的概念确实存在表现得更清楚。由于“概念难度”不在考虑范围内,因此考虑这些属性并决定MVC是否适合特定应用程序要容易得多。

edit -- having said that, if I were new to ASP.NET, I would probably tackle the forms version first and get a good understanding of events, postback, and the methodology of that system before going into MVC because ASP.NET MVC is really handled on top of that system.

编辑 - 说过,如果我是ASP.NET的新手,我可能会首先处理表单版本并在进入MVC之前很好地理解事件,回发和该系统的方法,因为ASP.NET MVC是真的处理在该系统之上。

edit 2 - I think I got voted down before finishing my edits :-(

编辑2 - 我想我在完成编辑之前已经投了票:-(

#5


4  

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

我建议您阅读一本关于ASP.NET MVC的书,并阅读本书中的示例。不要过分担心MVC设计模式的历史,或者它是1979年Xerox PARC的根源。我不打算阅读更多关于实际MVC模式的内容,而不是MSDN中的这篇简单文章:前沿:ASP.NET演示模式

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.

我最近完成了Steve Sanderson的Pro ASP.NET MVC框架,我可以推荐它。它有一个多章节示例应用程序,可以让您快速使用ASP.NET MVC,然后是10个左右的后续章节,深入介绍相关主题(控制器,视图,安全性等)。本书重点关注单元测试和依赖注入,还介绍了LINQ to SQL的基本对象关系映射。还有一些章节介绍了如何将jQuery与ASP.NET MVC集成,以及如何利用传统WebForms应用程序中的框架组件(授权,成员资格,角色,个性化,缓存等)。

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.

史蒂夫博客上有许多正面评论,这也是其他ASP.NET信息的良好来源。 Amazon.com对这本书有一些积极的评论(当我获得一些空闲时间时,我需要添加我的)。您还可以在Google图书上预览部分图书。


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?

Wrox:开始ASP.NET MVC 1.0 ---两位作者Keyvan Nayyeri和Simone Chiaretta都是活跃的ASP.NET MVC博主。这里有一个关于测试下载的示例章节。我读过它应该在2009年6月底上市吗?

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.

Manning:ASP.NET MVC in Action ---本书由Ben Scheirman,Jeffrey Palermo和Jimmy Bogard撰写。他们都有有趣的博客,涵盖ASP.NET MVC相关主题。如果我没有正确地听到,这本书应该在2009年8月出版。你可以在这里预订这本书(MEAP = Manning Early Access Program)并访问前11章(我认为未编辑或松散编辑)。 CodeCampServer参考应用程序是本书的补充,它涵盖了使用nHibernate(ORM),Castle Windsor(DI / IoC),DDD,单元,集成和回归测试。

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.

Wrox:专业的ASP.NET MVC 1.0 ---这是随后提供的NerdDinner示例应用程序和阅读器附带的书。它由一些非常聪明的微软人员撰写:Rob Conery,Scott Guthrie,Scott Hanselmann和Phil Haaaaaaaaaaaa,他们掌握了为什么用框架做出某些决定的内幕消息。现在有空。

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.

Packt:ASP.NET MVC 1.0快速---作者Maarten Balliauw有一个非常好的博客,讨论各种ASP.NET MVC问题,包括测试。现在有空。

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.

Sams:ASP.NET MVC框架释放---作者Stephen Walther负责ASP.NET早期1.0版的一些流行的ASP.NET Unleashed书籍,现在他正在写一本关于ASP.NET MVC的书。您可以查看他的博客,了解即将出版的书籍和其他ASP.NET MVC相关帖子中的示例内容。亚马逊称这本书将于2009年7月上市。

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.

Wrox:ASP.NET MVC网站编程问题设计解决方案---这似乎是本书Wrox:ASP.NET 2.0网站编程:问题设计解决方案的后续版本,欢迎回复作者Marco Bellinaso并介绍两位新作者项目Nick Berardi和Al Katawazi。本书的示例应用程序是Beerhouse CMS,可在CodePlex上下载。该书的网站称它将于2009年6月发布。

#6


3  

If you don't already know Webforms, then stick to learning just MVC right now so that you don't confuse yourself. Webforms is a useful thing to know, and since you know Winforms already, it shouldn't be too hard to learn afterward.

如果您还不了解Webforms,那么现在就坚持学习MVC,这样就不会让自己感到困惑。 Webforms是一个有用的东西,因为你已经了解Winforms,所以后来学习它不应该太难。

MVC and Webforms both work under ASP.NET, so a lot of things you'll learn while playing with MVC will carry over to Webforms.

MVC和Webforms都可以在ASP.NET下工作,因此在玩MVC时你将学到的很多东西都会转移到Webforms上。

#7


3  

This is a good introduction from Martin Fowler. He talks in detail about GUI Architectures.

这是Martin Fowler的一个很好的介绍。他详细讨论了GUI架构。

Start reading some material on the following topics and they will really help you gear yourself towards any MVC in general. Here are some topics that you can look up online:

开始阅读以下主题的一些材料,它们将真正帮助您适应任何MVC。以下是您可以在线查看的一些主题:

  • Routing.
  • 路由。
  • The MVC Pattern.
  • MVC模式。
  • Controllers and Actions.
  • 控制器和动作。
  • Mapping parameters.
  • 映射参数。
  • ActionResults.
  • ActionResults。
  • Error handling.
  • 错误处理。
  • Action filtering.
  • 动作过滤。
  • Passing data to a view.
  • 将数据传递给视图。
  • HTML Helpers.
  • HTML助手。
  • View rendering extensibility.
  • 查看呈现可扩展性。
  • Using jQuery with ASP.NET MVC.
  • 在ASP.NET MVC中使用jQuery。
  • Best practice tips for views, controllers, and models.
  • 视图,控制器和模型的最佳实践技巧。
  • MVC Anti-patterns.
  • MVC反模式。

#8


2  

It might help to approach Asp.Net MVC from a different angle: Read the Agile Web Development With Rails book, follow along (implement using Rails), and try to implement a project of similar scope to what's in that book in ASP.Net MVC.

从不同的角度来看待Asp.Net MVC可能会有所帮助:阅读Agile Web Development with Rails一书,跟随(使用Rails实现),并尝试实现一个类似于ASP.Net MVC中该书的内容的项目。

You'll pick up Rails quickly (a week or two of hacking around a couple of hours a night), and the explication of the conventions of Rails will guide you into a mindset that aligns fairly closely with the Asp.Net MVC way. It'll probably help you understand the motivations for MVC along the way, and you'll certainly have opinions about how things "should" work in Asp.net MVC.

你可以快速拿起Rails(一周或两周左右的黑客攻击),Rails惯例的解释将引导你进入一种与Asp.Net MVC方式非常接近的思维模式。它可能会帮助您了解MVC的动机,并且您肯定会对Asp.net MVC中的“应该”如何工作有所了解。

#9


2  

I would spend some time on ASP.NET first before learning ASP.NET MVC. Remember, ASP.NET MVC is based on ASP.NET. Some things from traditional ASP.NET won't be used with the MVC model (user controls, (ASCX and ASPX files)) but it is a good thing to still understand these. If you want to focus on MVC, first learn ASP.NET but do not spend time studying the common controls or databinding.

在学习ASP.NET MVC之前,我会先花一些时间在ASP.NET上。请记住,ASP.NET MVC基于ASP.NET。传统ASP.NET中的一些东西不会与MVC模型(用户控件,(ASCX和ASPX文件))一起使用,但仍然理解这些是一件好事。如果你想专注于MVC,首先要学习ASP.NET,但不要花时间研究常用控件或数据绑定。

The rest of ASP.NET is still useful (HttpModules, HttpHandlers, the web.config file, the membership provider, etc) when you're doing ASP.NET MVC, and I'd say likely a prerequisite to really using ASP.NET MVC well.

当你在做ASP.NET MVC时,ASP.NET的其余部分仍然有用(HttpModules,HttpHandlers,web.config文件,成员资格提供程序等),我想说可能是真正使用ASP.NET的先决条件MVC很好。

That said, there is a lot more work for ASP.NET out there than ASP.NET MVC. Some employers are looking for people who know MVC, but they are mainly doing that as they are looking for people who are passionate about learning new things. My concern with ASP.NET MVC is that I don't see how to integrate it with traditional ASP.NET applications. The reality is most jobs out there involve working with an existing codebase, not starting from scratch.

也就是说,除了ASP.NET MVC之外,ASP.NET还有很多工作要做。一些雇主正在寻找了解MVC的人,但他们主要是这样做,因为他们正在寻找热衷于学习新事物的人。我对ASP.NET MVC的关注是我没有看到如何将它与传统的ASP.NET应用程序集成。事实上,大多数工作涉及使用现有的代码库,而不是从头开始。

#10


2  

I'd been following ASP.Net MVC pretty much from the beginning, and I have to say, I love it. Combined with Unity (or another DI framework) it just flows nicely. I've always liked a certain separation of concerns principle anyhow, and favored ASP.Net over PHP (and classic ASP). I didn't always like the control pattern of ASP.Net though. MVC fits much better. And with Json() and PartialView() for return types interacting with jQuery.getJSON() and $("#mydiv").load() is very simplified on the server-side. It also works well when following SOLID Design principles...

我从一开始就一直在关注ASP.Net MVC,我不得不说,我喜欢它。结合Unity(或另一个DI框架),它只是很好地流动。无论如何,我总是喜欢某种关注点分离原则,并且比PHP(和经典ASP)更喜欢ASP.Net。我并不总是喜欢ASP.Net的控件模式。 MVC非常适合。使用Json()和PartialView()返回类型与jQuery.getJSON()和$(“#mydiv”)交互。在服务器端,load()非常简化。遵循SOLID设计原则时它也很有效......

It does help to have a solid understanding of HTML and JavaScript (AJAX, DHTML) for more interactive points. It also helps to think in terms of the MVC pattern, or not thinking about cluttering your controller and your data.

对于更多交互点,它有助于深入理解HTML和JavaScript(AJAX,DHTML)。它还有助于根据MVC模式进行思考,或者不考虑使控制器和数据混乱。

One thing I don't care as much for, is the lack of a built in skinning system, for multiple skins on a web-app. I've come around this, and having the source really helps. I would say as other have suggested, follow the blogs (and read back) of Phil Haack, Scott Guthrie, and Scott Hanselman. They all have vital information. Beyond this, as also mentioned, the demos on the ASP.Net MVC Website are very good.

我不太关心的一件事是缺少内置的皮肤系统,对于网络应用程序上的多个皮肤。我已经解决了这个问题,让源代码真正有用。我会像其他人所说的那样,跟随Phil Haack,Scott Guthrie和Scott Hanselman的博客(并回读)。他们都有重要的信息。除此之外,正如前面提到的,ASP.Net MVC网站上的演示非常好。

#11


1  

Apart from what others have recomended I would suggest the following two books:

除了别人的建议之外,我会建议以下两本书:

  • Spring in Action : It's not ASP.NET MVC, it's about Spring, but the foundations are similar and it's really well written.
  • Spring in Action:它不是ASP.NET MVC,它是关于Spring的,但它的基础是相似的,而且写得非常好。
  • Pro ASP.NET MVC 2 Framework : It explains the concepts in an easy to follow way, and it helps introduce DI into ASP.NET MVC.
  • Pro ASP.NET MVC 2框架:它以易于理解的方式解释概念,并有助于将DI引入ASP.NET MVC。

#12


0  

All previous post are so cool :) but i want to add my own view. Without some base of asp.net runtime mechanism you can't write a good app. This info you could get from dino esposito book(he has two books about asp.net 2.0 - basic and advanced level) in basic level - there is one chapter about processing incoming request - you could read only this chapter.

所有以前的帖子都很酷:)但我想添加自己的观点。没有一些asp.net运行时机制的基础,你不能写一个好的应用程序。您可以从基本级别的dino esposito书(他有两本关于asp.net 2.0的书籍 - 基础和高级水平)获得这些信息 - 有一章关于处理传入的请求 - 您只能阅读本章。

If you know what is httpapplication, httpruntime, request, response etc. just skip my answer.

如果您知道什么是httpapplication,httpruntime,请求,响应等,请跳过我的回答。

#13


0  

I know from my brief time with a Ruby on Rails job, coming back to ASP.NET and working with MVC it was easy to apply what I learned from RoR to ASP.NET MVC. Truthfully, ASP.NET MVC is actually just about the VC part and not much about the Model since ASP.NET doesn't have to be very REST based whereas RoR practically enforces it.

我从简短的时间开始知道Ruby on Rails的工作,回到ASP.NET并使用MVC,很容易将我从RoR学到的知识应用到ASP.NET MVC。说实话,ASP.NET MVC实际上只是关于VC的部分而不是模型,因为ASP.NET不必非常基于REST,而RoR实际上强制执行它。

The problem I find is trying to get people to learn correct conventions of MVC when they are first learning it by coming from ASP.NET itself. Like others have mentioned, it might be a good idea to learn a true MVC platform (in this case RoR) because trying to apply what you know about ASP.NET to a MVC architecture. A good place to start with RoR is http://railsforzombies.org/ It's also kind of fun and will give you the basics for what really goes where in the ideal REST MVC scenario. After that apply what you know to the MVC for ASP.NET.

我发现的问题是,当他们第一次从ASP.NET本身学习它时,试图让人们学习正确的MVC约定。像其他人提到的那样,学习真正的MVC平台(在本例中为RoR)可能是一个好主意,因为尝试将您对ASP.NET的了解应用于MVC架构。一个开始使用RoR的好地方是http://railsforzombies.org/它也很有趣,它将为您提供理想REST MVC场景中真正有用的基础知识。之后,将您所知道的内容应用于MVC for ASP.NET。

#14


0  

The very first and basic thing with ASP.Net MVC is the Routing concepts. LEarn this well first. You can also go throught System.Web.Routing Namespace on getting some more idea on this. Routing is just telling the IIS that is there is a request for a particular extension then redirect to this handler.

ASP.Net MVC的第一个基本要点是路由概念。先学会好。您还可以通过System.Web.Routing命名空间了解更多信息。路由只是告诉IIS,是否有特定扩展的请求,然后重定向到此处理程序。

The next thing would "Convention over configuration". For MVC you need to have a particular folder structure like Controller,Model and Views .Nothing more mystery here.

接下来的事情将是“约会过度配置”。对于MVC,您需要具有特定的文件夹结构,如Controller,Model和Views。这里没有更多的谜。