随笔分类 - ASP.NET MVC
ASP.NET MVC
摘要:1-在 aspx和aspx.cs中,都是以Session["xxx"]="aaa"和aaa=Session["xxx"].ToString()进行读写。 而在ashx中,Session都要使用context.Session,读写方法是这样的: context.Session["xxx"]="aa...
阅读全文
摘要:一 web.config 配置:1). 2).注意:when set to"debug=true" mode, the runtime will ignore the timeout setting.二.详细代码:http:/...
阅读全文
摘要:Controllers: public ActionResult Index() { return View(db.GuestBooks.ToList()); } // // GET: /Guest2/ ...
阅读全文
摘要:一、Ueditor插件下载自:http://ueditor.baidu.com/website/二、将解压文件目录ueditor复制到项目根目录后, 修改以下几个文件配置: 1.访问路径配置:ueditor.config.js //为编辑器实例添加一个路径,这个不能被注释 ...
阅读全文
摘要:1.首先创建一控制器文件UpFileController.cs:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace Mvc4St...
阅读全文
摘要:一.命令开启1.打开控制台:视图->其他窗口->程序包管理器控制台;2.启动数据库迁移,执行命令:enable-migrations 创建成功后会新增migrations目录等。 若报如下错误: PM> Enable-Migrations More than one context ...
阅读全文
摘要:在EF5.0添加实体数据到数据库的时候,出现“对一个或多个实体的验证失败。有关详细信息,请参见“EntityValidationErrors”属性这个错误解决:SaveChanges前先关闭验证实体有效性(ValidateOnSaveEnabled)这个开关db.Configuration.Vali...
阅读全文
摘要:ASP.NET MVC 4 中添加的一数据模型[DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Computed)] public DateTime? Crea...
阅读全文

浙公网安备 33010602011771号