码迷,mamicode.com
首页 > Web开发 > 详细

MVC-Html.Label(TextBox、TextArea、RadioButton、CheckBox)

时间:2015-05-28 12:30:39      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:

红色表示可选参数。

@Html.Label("name", "value", new { @class = "class", @style = "color:Red;" })

<label class="class" style="color: red;" for="name">value</label>

@Html.TextBox("name", "value", new { @class = "txt", @style = "width:200px;" })

<input name="name" class="txt" id="name" style="width: 200px;" type="text" value="value"></input>

@Html.TextArea("name", "value", new { @class = "txt", @rows = "4", @cols = "10" })

<textarea name="name" class="txt" id="name" rows="4" cols="10">value</textarea>

@Html.RadioButton("name", "value1", true, new { @class = "xx" })        

@Html.RadioButton("name", "value2")
<input name="name" class="xx" id="name" type="radio" checked="checked" value="value1"></input>
<input name="name" id="name" type="radio" value="value2"></input>

@Html.CheckBox("name", true, new { @class = "cc" })
<input name="name" class="cc" id="name" type="checkbox" checked="checked" value="true"></input>
<input name="name" type="hidden" value="false"></input>

MVC-Html.Label(TextBox、TextArea、RadioButton、CheckBox)

标签:

原文地址:http://www.cnblogs.com/yaosuc/p/4535383.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!