
mvc
MrCui.
您好,
展开
-
jqGrid在MVC中使用方法
Views $(document).ready( function () { $("#table_list_2").jqGrid( { ur原创 2016-08-04 08:43:03 · 1473 阅读 · 0 评论 -
Ajax同步获取数据
async设置为false就可以(默认是true)$.ajax({ type: "POST", url: "/Administration/XieYi", data: "ID=" + ID, async: false, success: function (data) { }});原创 2017-07-18 21:25:05 · 2831 阅读 · 0 评论 -
通过轮询实现消息弹窗提醒
Html State_Restart 通知 系统将在1分钟后重启,请保存好当前操作!!! JavaScript$(document).ready(function原创 2017-07-18 21:23:23 · 3481 阅读 · 0 评论 -
获取Json对象的长度
有两种Json形式:第一种:var json1 = {"data":[{"name":"zs","age":"10"}]};对于这种格式的json数据,如果想获取data的长度,就可以用以下这种方式:var length = json1.data.length;但是如果想获取json的长度呢?看第二种格式var json2 = {"name":"zs","age":"10"};原创 2017-07-18 21:18:41 · 77796 阅读 · 7 评论 -
ASP.NET MVC中将数据从Controller传递到视图方法
ASP.NET MVC中将数据从Controller传递到视图方法1.ViewDataViewData的类型是字典数据,key-value 如:ViewData["Data"]2.ViewBagViewBag是dynamic类型,访问比较方便,直接"."就可以了 如:ViewBag.Data,ViewData与ViewBag可以数据共享,比如说 ViewData["Data"] =原创 2017-07-18 21:15:15 · 1325 阅读 · 0 评论 -
Bootstrap Search Suggest 插件使用
Controllerspublic ActionResult Index() { YuXi(); return View(); } public void YuXi() { var query = from a in entities.CESHI原创 2016-11-14 22:12:47 · 1386 阅读 · 0 评论 -
DataTable 转换成 Json的3种方法
在web开发中,我们可能会有这样的需求,为了便于前台的JS的处理,我们需要将查询出的数据源格式比如:List、DataTable转换为Json格式。特别在使用Extjs框架的时候,Ajax异步请求的数据格式就是Json。鉴于此,我今天来分享将DataTable 转换成 Json的3种方法。换句话说如何在ASP.NET将一个DataTable序列化为 Json数组。或者如何从一个DataTable返转载 2016-11-02 20:36:25 · 53202 阅读 · 2 评论 -
Asp.Net判断某年某月总天数
Controllers public static int GetDays(int year, int month) { int[] days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (month == 2 && ((year % 4 == 0 &&原创 2016-10-28 15:48:20 · 928 阅读 · 0 评论 -
jquery点击table表头排序
Views 序号 书名原创 2016-10-26 10:30:17 · 5024 阅读 · 1 评论 -
MVC ViewBag 传多个Model到视图
Controllersvar sbpay= entities.SB_BASE_YEAR.Where(b => b.SB_CITY == id ); ViewBag.sbpay = sbpay;Views foreach (var sbpay in ViewBag.sbpay)原创 2016-10-28 11:58:46 · 2748 阅读 · 0 评论 -
MVC提交表单(方法二)
YuXi-钰玺博客同步更新http://www.studenty.cn原创 2016-11-05 13:56:42 · 359 阅读 · 0 评论 -
MVC提交Form表单(方法一)
YuXi-钰玺博客 http://www.studenty.cn/ 同步更新原创 2016-11-04 21:38:09 · 4336 阅读 · 0 评论 -
.NET MVC 时间格式View显示问题
将2016/09/27 0:00:00 转换为 2016/09/27@if (item.字段!= null) { @Html.DisplayFor(modelItem => item.字段).ToString().Substring(0, 9) } else { @Html.DisplayFor(modelItem => item.字段原创 2016-09-27 11:13:37 · 3773 阅读 · 0 评论 -
MVC提示框
在Body中写 在脚本中写 function ts(){ swal({ title: "Auto close alert!", text: "I will close in 2 seconds.", timer: 2000, showConfirmButton: false }); } if (@ViewData["tishi"] == 888)原创 2016-08-18 16:54:28 · 933 阅读 · 1 评论 -
MVC按钮单击事件写法
Views Controllers public ActionResult Login(string queren) { if (queren == "确认") { } return View(); }原创 2016-08-02 13:09:18 · 20267 阅读 · 0 评论 -
MVC取文本框中的值
ViewsControllerspublic ActionResult Index(FormCollection txt) { string u_name= txt["u_name"]; }原创 2016-08-02 13:01:15 · 4998 阅读 · 0 评论 -
ASP.NET连接Oracle数据库方法
Web.config 文件写原创 2016-07-27 14:23:06 · 708 阅读 · 0 评论 -
Linq利用Distinct去除重复项(可自己指定)
添加一个扩展方法public static IEnumerable DistinctBy (this IEnumerable source, Func keySelector){ HashSet seenKeys = new HashSet(); foreach (TSource element in source) { if (seenKeys.Add(原创 2017-07-18 21:32:22 · 36337 阅读 · 3 评论