02 2016 档案

摘要:转换方法代码: 1 #region SafeParse 2 public static bool SafeParseBool(object target, bool defaultValue) 3 { 4 if (target == null) return defaultValue; 5 stri 阅读全文
posted @ 2016-02-29 17:50 赛跑的蜗牛 阅读(346) 评论(0) 推荐(0)
摘要:占位符的使用: 下面是一个模板页 _Layout.cshtml <!DOCTYPE html> <html> <head> @RenderSection("headtop", false) @RenderSection("head", false) </head> <body id="body"> 阅读全文
posted @ 2016-02-29 16:26 赛跑的蜗牛 阅读(444) 评论(0) 推荐(0)
摘要:1 //URL: http://localhost:1897/User/Press/UserContent.aspx/9878?id=1#toc 2 Request.ApplicationPath; //结果: / 3 Request.PhysicalPath; //结果: D:\Projects\ 阅读全文
posted @ 2016-02-29 15:06 赛跑的蜗牛 阅读(915) 评论(0) 推荐(0)
摘要:两种方法: 后端的一般处理程序:Imge.ashx 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI.WebContro 阅读全文
posted @ 2016-02-27 22:05 赛跑的蜗牛 阅读(3621) 评论(0) 推荐(0)
摘要:关于url编码,js有三个函数。有三个解码方法,escape,encodeURI,encodeURIComponent()。有三个解码方法,unescapse,decodeURI,decodeURIComponent。1、escape()不能直接用于URL编码,它的真正作用是返回一个字符的Unico 阅读全文
posted @ 2016-02-27 21:33 赛跑的蜗牛 阅读(1527) 评论(0) 推荐(0)
摘要:第一步:先引用jQuery的插件jquery-1.9.1.min.js 第二步:引用jquery.cookie.js插件 下对cookie的操作: $.cookie("cookieName", "cookieValue", { expires: 10, //有效日期 以 天 为单位 如果此项未设置则 阅读全文
posted @ 2016-02-27 20:55 赛跑的蜗牛 阅读(354) 评论(0) 推荐(0)
摘要:创建cookie: 1 HttpCookie cookie = new HttpCookie("CurrentUser"); //创建一个名称为CurrentUser 的cookie对象 2 cookie.Values.Add("UserId", "1"); //在cookie对象添加 一项键值对 阅读全文
posted @ 2016-02-27 19:32 赛跑的蜗牛 阅读(303) 评论(0) 推荐(0)
摘要:日期格式化{0:yyyy-MM-dd HH:mm:ss.fff}与{0:yyyy-MM-dd hh:mm:ss.fff}的区别 使用24小时制格式化日期:{0:yyyy-MM-dd HH:mm:ss.fff}使用12小时制格式化日期:{0:yyyy-MM-dd hh:mm:ss.fff}以下同理,从 阅读全文
posted @ 2016-02-25 17:45 赛跑的蜗牛 阅读(8183) 评论(0) 推荐(0)
摘要:先要引用在程序集 System.Web.Extensions.dll 的类库,在类中 using System.Web.Script.Serialization 命名空间。 1、定义一个强类型的类(model): 1 [Serializable] 2 public class Person 3 { 阅读全文
posted @ 2016-02-25 17:31 赛跑的蜗牛 阅读(358) 评论(0) 推荐(0)
摘要:最近做项目的时候需要做批量打印订单,一个订单可能在最后一页是的内容是不足一页的,这时候下一个订单需要下一页打印,这样就需要强制换页。在下一页再打印下一个订单 部分代码: 部分重要的css是分页的换页的关键: 1 <style type="text/css"> 2 @media print 3 { 4 阅读全文
posted @ 2016-02-25 16:09 赛跑的蜗牛 阅读(13270) 评论(1) 推荐(0)
摘要:代码: 1 /// <summary> 2 /// HTML Table表格数据(html)导出EXCEL 3 /// </summary> 4 /// <param name="tableHeader">表头</param> 5 /// <param name="tableContent">内容< 阅读全文
posted @ 2016-02-25 09:51 赛跑的蜗牛 阅读(1188) 评论(0) 推荐(0)
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.or 阅读全文
posted @ 2016-02-24 15:44 赛跑的蜗牛 阅读(3972) 评论(0) 推荐(0)
摘要:代码: js: function countDown(time, id) { //time的格式yyyy/MM/dd hh:mm:ss var day_elem = $(id).find('.day'); var hour_elem = $(id).find('.hour'); var minute 阅读全文
posted @ 2016-02-23 18:10 赛跑的蜗牛 阅读(618) 评论(1) 推荐(0)
摘要:代码: function jsonDateFormat(jsonDate) {//json日期格式转换为正常格式 try { var date = new Date(parseInt(jsonDate.replace("/Date(", "").replace(")/", ""), 10)); va 阅读全文
posted @ 2016-02-23 18:04 赛跑的蜗牛 阅读(531) 评论(0) 推荐(0)
摘要:代码: 方法一: $.extend({ getUrlVars: function () { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).spli 阅读全文
posted @ 2016-02-23 17:42 赛跑的蜗牛 阅读(1268) 评论(0) 推荐(0)
摘要:代码: /***防止多触发**id 必须唯一*fn 回掉函数*wait 延迟多长时间**使用例子:* ToPreventMoreTrigger('id', function () {//注意 id 是唯一的* //响应事件* fun();* }, 500);*******/var _timer = 阅读全文
posted @ 2016-02-23 17:24 赛跑的蜗牛 阅读(270) 评论(0) 推荐(0)
摘要:完整代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www 阅读全文
posted @ 2016-02-23 17:07 赛跑的蜗牛 阅读(443) 评论(1) 推荐(0)
摘要:完整代码: 阅读全文
posted @ 2016-02-23 10:45 赛跑的蜗牛 阅读(8105) 评论(1) 推荐(0)
摘要:在http调用时获取到的json数据中文是乱码的解决方法: 中文转Unicode:HttpUtility.UrlEncodeUnicode(string str);转换后中文格式:"%uxxxx" 举例:"柳_cdse53214" 转换结果是:"%u67f3_cdse53214" Unicode转中 阅读全文
posted @ 2016-02-17 15:29 赛跑的蜗牛 阅读(1940) 评论(0) 推荐(0)