MVC学习 - MVC新手,学习的先决条件 [英] MVC Learning-New to MVC, prerequisites to learn

查看:66
本文介绍了MVC学习 - MVC新手,学习的先决条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经开始学习MVC了。

我正在从学习教程之一制作一个示例应用程序。

我用过使用丰富的ASP.Net Server控件,如网格视图,Datalist,身份验证和验证控件,它们在MVC中不存在,

当我添加View时,Razor View Engine有一个选项(cshtml)和genrated视图有cshtml的扩展,而且视图中生成的HTML有点吓人,因为它包含HTML对象方法和等等...(不像通常的asp.net html)。

我喜欢c#和代码,我不是一个优秀的HTML开发人员。我主要通过C#来做。



所以我必须学习一个装满Razor视图引擎的东西,那个可怕的HTML来掌握MVC ??

学习MVC的基本先决条件是什么?

Hi,
I have started learning MVC.
I was making a sample App from One of learning tutorial.
I am used to work with rich ASP.Net Server controls like Grid View, Datalist, Authentication and Validation controls, they are not present in MVC,
When I was adding a View, there was a option for Razor View Engine(cshtml) and genrated views had a extension of cshtml, moreover the generated HTML in views was little scary as it contained HTML objects methods and blah blah...(not like usual asp.net html).
I love c# and code behind and I am not a superb HTML developer. I do it mostly through C#.

So do I have to Learn a bag full of things like Razor view engine, that scary HTML to master MVC??
What are basic prerequisites to learnMVC?

推荐答案

嗨!!!

看一下这个链接



7天内逐步学习MVC(模型视图控制器) - 第1天 [ ^ ]


了解 HTML ,JavaScript,CSS ,显然 C# VB 就是你需要的一切< b>优秀的MVC开发人员。



如果您不了解客户端部分(即HTML,CSS,JS等),则不应进行任何Web开发。确实有几个人只有用户asp.net web服务器控制,但这真的限制了你可以做的事情。



MVC 使用与Web表单不同的开发方法(关注点和测试能力的明确分离是重要概念),这应该是您的学习曲线所在。



当你想要做一些更高级的东西时,它还有助于了解一些关于网络服务器如何在内部工作的东西。



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



这里有很多非常有用的教程:所有关于MVC [ ^ ]
Knowing HTML, JavaScript, CSS and obviously C# or VB is all you need to be a good MVC developer.

You shouldn't be doing any web development if you don't know the client part (ie, HTML, CSS, JS; etc). It's true that there are several guys out there that only user asp.net web server controls, but that really limits what you can do.

MVC uses a different approach to development than web forms (where clear separation of concerns and test-ability are important concepts) and this should be where your learning curve should be.

It also helps to know some stuff about how a webserver works internally when you want to do some more advanced stuff.

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: ALL about MVC[^]


你好,



显然你应该知道用于在MVC中开发Web应用程序的C#和HTML 。

MVC为您正在谈论的传统Web表单和服务器控件打开了新的大门。 MVC使用完全不同的方法来开发Web应用程序而不是Web表单。

MVC比Web表单更清晰,其中您的业务逻辑和UI根据其关注点分开。即 M odels, V iews和 C 控制器。控制器将您的业务逻辑保存在您的视图所在的UI中。这在Web表单中是不可能的,其中您将业务逻辑附加为.cs页面后面的代码。



除此之外,MVC支持TDD(测试驱动开发)。访问此链接 [ ^ ]



好​​吧,这些是MVC背后的一些基本想法,但如果你主要关心的是HTML,那么不要让 Razor 及其扩展吓到你。 :)



Razor只是MVC中的一个视图引擎。 MVC不仅仅是一个视图引擎(不考虑没有View引擎的MVC)。您可以使用asp.net Web表单的.aspx / .ascx文件模板作为您的视图引擎。



Razor不是一种编程语言,但它使用C#syntex进行嵌入视图页面中的代码(当然,您遇到过想要在HTML页面中嵌入一些逻辑的情况......很久以前......)。你可以访问这个链接 [ ^ ] for关于Razor的更多知识



ASP.Net MVC 6包含名为Tag助手的功能的另一个好消息。

TagHelpers [ ^ ]



如果有帮助,请标记为答案。





问候。
Hi there,

Obviously you should know C# and HTML for developing web applications in MVC.
MVC open new doors over traditional web forms and server controls you are talking about. MVC uses totally different approach of developing web applications than web forms.
MVC has more clearer architecture than web forms where your business logic and the UI are separated according to its concerns. I.e. Models, Views and Controllers. controllers hold your business logic where your views hold your UI. this was not possible in web forms where you had business logic attached as code behind .cs pages.

other than this, MVC supports TDD(test driven development). Visit this Link[^]

well, these are some basic ideas behind MVC but if your major concern is HTML than don't let Razor and its extension scare you. :)

Razor is just a view engine in MVC. MVC is much more than just a view engine(don't think about MVC without View engine too). You can use .aspx/.ascx file templates of asp.net web forms as your view engine.

Razor is not a programming language but it uses C# syntex for embedding code in a view page(of course you have faced such situations where you wanted to embed some logic inside your HTML page....long years ago..). you can visit this link[^] for more knowledge about Razor

one more good news that ASP.Net MVC 6 includes the feature named as Tag helpers.
TagHelpers[^]

please mark as answer if it helps.


Regards.


这篇关于MVC学习 - MVC新手,学习的先决条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆