Asp.net MVC 4 的Helloword入门

本文工程代码托管在: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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值