本文工程代码托管在:https://github.com/Wuchenwcf/MyCode/tree/master/C%23/MVCHelloword
一、环境
本文使用vs2012
二、步骤
1.创建工程
2.使用Internet应用程序模版
3.工程建立起来之后就已经有了一个简单的框架了,可以直接运行,跑起来看看
3.创建Controller
为了写我们的Helloworld,我们来创建一个自己的Controller
4.修改代码
5.再跑跑看
三、总结
这只是一个入门,更多内容可参考微软的官方文档:https://docs.microsoft.com/en-us/aspnet/mvc/mvc4
The first argument to the ActionLink method is the link text to render (for example, <a>Edit Me</a>). The second argument is the name of the action method to invoke. The final argument is an anonymous object that generates the route data (in this case, the ID of 4).
The Html.LabelFor helper displays the name of the field ("Title", "ReleaseDate", "Genre", or "Price"). The Html.EditorFor helper renders an HTML <input> element. The Html.ValidationMessageFor helper displays any validation messages associated with that property.