摘要: //$.get("/Home/index/" + $("#S_BookName").val(), function (data) { //MVC控制器返回View(Model) 是没有绑定后的html页面 // console.log(data); // //var Number1 = data.indexOf("");//第二个索... 阅读全文
posted @ 2018-01-11 15:28 enych 阅读(1021) 评论(0) 推荐(0) 编辑
摘要: string UserName = context.Request["username"]; string PassWord = context.Request["pwd"]; //连接数据库 SqlConnection con = new SqlConnection("server=.;database=test;uid=... 阅读全文
posted @ 2018-01-10 10:02 enych 阅读(132) 评论(0) 推荐(0) 编辑
摘要: textBox1.Text = dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"); int[] arr = { 100, 20, 2, 4, 104, 1, 21, 101, 102, 201, 202 }; var data = arr.Where(n => n... 阅读全文
posted @ 2018-01-10 09:36 enych 阅读(302) 评论(0) 推荐(0) 编辑
摘要: public ActionResult Index(string id)//主页 //参数string searchString 访问方式为index?searchString=xxxx 。参数string id 访问方式为index/x { string searchString = id; //return View... 阅读全文
posted @ 2018-01-09 17:54 enych 阅读(426) 评论(0) 推荐(0) 编辑
摘要: return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //HttpStatusCode statusCode 枚举 // HttpStatusCode.BadRequest = 400, public HttpStatusCodeResult(HttpStatusCode statusCode);//带参的构造函数 Htt... 阅读全文
posted @ 2018-01-09 17:17 enych 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-01-09 11:15 enych 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 模板(在Views下新建文件夹Shared;在Shared下新建模板页) 子页面(在views文件夹下新建视图_ViewStart) 阅读全文
posted @ 2018-01-08 11:44 enych 阅读(138) 评论(0) 推荐(0) 编辑
摘要: public class HomeController : Controller { // GET: Home public ActionResult Index() //控制器名Home下默认的一个方法 { return View();//返回视图 } [HttpPost]//表单... 阅读全文
posted @ 2018-01-08 11:05 enych 阅读(215) 评论(0) 推荐(0) 编辑
摘要: IIS服务器web核心没有安装造成的 阅读全文
posted @ 2018-01-08 10:29 enych 阅读(224) 评论(0) 推荐(0) 编辑
摘要: //查询 //查询指定字符串出现的个数,类似于模糊查询select count(*) from Book where Name like '%字符串%' db.Book.Where(x => x.Name.Contains(txtName.Text.Trim())).Count(); //接收查询的数据 List bk = db.Book.ToList(); dataGridView1.... 阅读全文
posted @ 2018-01-07 22:10 enych 阅读(154) 评论(0) 推荐(0) 编辑