Jquery删除功能实现和@Html.TextBoxFor将文本数据格式改为时间格式处理

Razor的出现,使页面看起更加简洁,Razor的页面后缀为:.cshtml
1、代码注释: 多行注释: @注释信息@
单行注释: // 注释

Jquery删除功能实现
https://www.cnblogs.com/haimishasha/p/5721773.html

https://blog.csdn.net/weixin_41909210/article/details/102476856

$(function(){
$(“input[type=‘button’]”).click(function() {
$(“input[name=‘test’]:checked”).each(function() { // 遍历选中的checkbox
n = $(this).parents(“tr”).index(); // 获取checkbox所在行的顺序
$(“table#test_table”).find(“tr:eq(”+n+")").remove();
});
});
});

@Html.TextBoxFor将文本数据格式改为时间格式

@Html.TextBoxFor(model => model.CreationDate,
new { @type = “date”, @Value = Model.CreationDate.ToString(“yyyy-MM-dd”) })

在这里插入图片描述
改为此格式后提示CS1501: 方法 ‘ToString’ 沒有任何多載使用 1 個引數
在这里插入图片描述
将其改为
@Html.TextBoxFor(x => x.Defect_Time, new { @readOnly = “true”, @class = “textboxreadonly”,@Value = Convert.ToDateTime(Model.Defect_Time).ToString(“yyyy-MM-dd”) })
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/caoguanghui0804/article/details/108038497