摘要: 1.传递中文之前,将要传递的中文参数进行编码,在接收时再进行解码。>> 进行传递string Name = "中文参数";Response.Redirect("B.aspx?Name="+Server.UrlEncode(Name));>> 进行接收string Name = Request.QueryString["Name"];Response.Write(Server.UrlDecode(Name));或者:NavigateURL='<%# "WebForm2.aspx?Singe 阅读全文
posted @ 2013-01-14 14:55 沅江 阅读(289) 评论(0) 推荐(0) 编辑
摘要: <fieldset><legend>文字</legend></fieldset> 阅读全文
posted @ 2013-01-09 10:04 沅江 阅读(102) 评论(0) 推荐(0) 编辑
摘要: DB db = new DB(); private int pageindex = 1;//当前页数 private int pagesize = 3000;//每页显示字符长度 private int maxsize = 3500;//每页显示最大字符长度 protected void Page_Load(object sender, EventArgs e) { if (Request["page"] != null) { pageindex = int.Parse(Request["page"]); } string sql = "sel 阅读全文
posted @ 2013-01-07 14:56 沅江 阅读(155) 评论(0) 推荐(0) 编辑
摘要: .content img{width:expression_r(this.width > 500 && this.height < this.width ? 500:true);max-width:500px;height:expression_r(this.height >500 ? 500:true);max-height:500px; } 阅读全文
posted @ 2013-01-06 17:12 沅江 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 1.可以用三元运算符来操作<%#Eval("b").ToString()=="1"?"font-weight:bold;": ""%>2.判断方法<%# Getcolor(Eval("b")) %>cspublic string Getcolor(object objtype) { string url = ""; return url; } 阅读全文
posted @ 2013-01-06 09:21 沅江 阅读(213) 评论(0) 推荐(0) 编辑
摘要: //获取日期+时间 DateTime.Now.ToString(); // 2008-9-4 20:02:10 DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12 //获取日期 DateTime.Now.ToLongDateString().ToString(); // 2008年9月4日 DateTime.Now.ToShortDateString().ToString(); // 2008-9-4 DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04 Da 阅读全文
posted @ 2013-01-06 09:08 沅江 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1>string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };string week = Day[Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"))].ToString();this.lbDay.Text = week;2>this.lbDay.Text = Syste 阅读全文
posted @ 2013-01-06 09:02 沅江 阅读(9191) 评论(0) 推荐(0) 编辑
摘要: //将系统时间转换成unix时间戳 public string timeunix(string time) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); DateTime dtNow = DateTime.Parse(DateTime.Now.ToString()); TimeSpan toNow = dtNow.Subtract(dtStart); string timeStamp = toNow.Ticks.ToString(); timeStamp = timeS. 阅读全文
posted @ 2012-12-13 17:32 沅江 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 用replace把字符串中的空格、回车、换行符 替换为""如:str=replace(replace(replace(str,chr(34),"") ,CHR(13),""),chr(10),"")chr(34),chr(13),chr(10)为对应的ASCII码 阅读全文
posted @ 2012-12-04 14:36 沅江 阅读(446) 评论(0) 推荐(0) 编辑
摘要: <%lm=request.QueryString("lm")if lm<>"" thendim s,sql,filename,fs,myfile,xSet fs = server.CreateObject("scripting.filesystemobject") select case lmcase "5"filename="XXX.xls"filename = Server.MapPath(filename) end select'--如果原来的EXCEL文件存在的 阅读全文
posted @ 2012-12-01 13:14 沅江 阅读(279) 评论(0) 推荐(0) 编辑