1.单选框
代码语言:javascript复制 @Html.RadiosFor("Sex", "09:30-10:30", new string[] { "1", "2", "3" }, new string[] { "男", "女", "未定" })
获取选中值
代码语言:javascript复制 //radio改变时候获取到值
$('input[type=radio][name=TimeBetween]').change(function () {
var val =$("input[name='TimeBetween']:checked").val();
});
2.复选框
代码语言:javascript复制 @Html.ChecksFor("ckLable", Model.Lable, new string[] { "客厅", "餐厅", "卧室"}, new string[] { "客厅", "餐厅", "卧室"})
获取选中的值逗号隔开
代码语言:javascript复制 var ids = new Array();
//获取所有选中的值,将其用逗号隔开
$('input[name="ckLable"]:checked').each(function (index, value) {
ids.push($(this).val());
})
$("#Lable").val(ids.join(','));
3.日期格式
代码语言:javascript复制<input id="BeginTime" name="BeginTime" value="" type="text" class="Wdate" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss', isShowToday: true, isShowClear: false,lang:'zh-cn' })" />
4.DataGri行内状态样式
代码语言:javascript复制<span class='label label-success'>成功</span>
<span class='label label-error'>失败</span>
<span class='label label-info'>信息</span>
<span class='label label-warning'>警告</span>
5.DataGrid操作按钮样式
代码语言:javascript复制{
field: 'Oper', title: '@Resource.操作', width: 80, sortable: false, align: 'center', formatter: function (value, row, index) {
return "<a class='fa fa-plus btn-icon-success' title='Create' onclick='Create("" row.Id "");'></a>"
"<a class='fa fa-pencil btn-icon-warning' title='Edit' onclick='Edit("" row.Id "");'></a>"
"<a class='fa fa-trash btn-icon-danger' title='Delete' onclick='Delete("" row.Id "");'></a>";
}
},
6.Tips提示信息框
代码语言:javascript复制<div class="showtip" id="showtip">
<div>
Tips:这是一条信息帮助的提示
</div>
</div>
7.超链接
代码语言:javascript复制<div><a href="#" class="a-org a-unline">橘红色</a></div>
<div><a href="#" class="a-blue a-unline">蓝色</a></div>
<div><a href="#" class="a-red a-unline">红色</a></div>
<div><a href="#" class="a-black a-unline">黑色</a></div>
<div><a href="#" class="a-org a-unline">橘红色带下划线</a></div>
<div><a href="#" class="a-blue a-unline">蓝色带下划线</a></div>
<div><a href="#" class="a-red a-unline">红色带下划线</a></div>
<div><a href="#" class="a-black a-unline">黑色带下划线</a></div>
注:后面会继续补充