上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 48 下一页
摘要: return Content("");返回并刷新页面:return Content("");context.Response.ClearContent();context.Response.Write(""); 阅读全文
posted @ 2013-06-06 22:47 James·wang 阅读(1010) 评论(0) 推荐(0)
摘要: TimeSpan表示一个时间段实例,两个时间的差就是一个TimeSpan实例。1、TimeSpan.Minutes——其他时间都一样,比较分钟的差,同样的还有:Hours,Second2、TimeSpan.TotalDays——两个时间段相差的日数,同样的还有:TotalHours,TotalMinutes,TotalSecondsstring time1 = "2013-6-6 8:10:00";string time2 = "2013-6-7 18:20:10";DateTime t1 = DateTime.Parse(time1);DateTime 阅读全文
posted @ 2013-06-06 20:40 James·wang 阅读(801) 评论(0) 推荐(0)
摘要: 从客户端(content="...safasasf<scrip>")中检测到有潜在危险的 Request.Form 值。 [Column(TypeName="ntext")] [MaxLength] [UIHint("Kindeditor")] [Required(ErrorMessage = "内容不能为空")] [AllowHtml] public string Content { get; set; }在Model里添加[AllowHtml]即可以避免此问题注意引用:using System.We 阅读全文
posted @ 2013-06-05 16:12 James·wang 阅读(410) 评论(0) 推荐(0)
摘要: @(i==1 ? "checked='checked'" :" ") 阅读全文
posted @ 2013-05-29 22:06 James·wang 阅读(4586) 评论(0) 推荐(0)
摘要: 首先加载如下代码:<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script><script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> @Ajax.Actio 阅读全文
posted @ 2013-05-29 11:15 James·wang 阅读(11282) 评论(3) 推荐(1)
摘要: <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> 阅读全文
posted @ 2013-05-29 09:26 James·wang 阅读(236) 评论(0) 推荐(0)
摘要: 在Entities:DbContext里添加如下代码: protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<Account>().HasRequired(b => b.User).WithMany(a => a.Accounts).WillCascadeOnDelete(true); base.OnModelCreating(modelBuilder); }这里Account是从表... 阅读全文
posted @ 2013-05-28 15:56 James·wang 阅读(336) 评论(0) 推荐(0)
摘要: 如题,不然会出现:错误是:该字符串未被识别为有效的布尔值。的错误提示。因为使用:@Html.CheckBoxFor会生成两个隐藏的input他们的值就是false 阅读全文
posted @ 2013-05-27 16:46 James·wang 阅读(1820) 评论(0) 推荐(0)
摘要: Html.BeginForm("actionName","controllerName",FormMethod.POST,new{@class="className"}) 阅读全文
posted @ 2013-05-27 11:42 James·wang 阅读(3597) 评论(0) 推荐(0)
摘要: @Html.ActionLink("删除", "Delete", "AccType", new { id = item.Atid }, new { @onclick ="return confirm('您确定要删除该记录吗?该操作不可恢复!') "}) 阅读全文
posted @ 2013-05-26 20:57 James·wang 阅读(218) 评论(0) 推荐(0)
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 48 下一页