08 2012 档案
纯JS的日历选择器
摘要:JS代码:// 日期选择var months = new Array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 阅读全文
posted @ 2012-08-29 15:27 LitDev 阅读(4419) 评论(2) 推荐(0)
C# 入门操作XML文件实例
摘要:首先看下XML文件的结构:<?xml version="1.0" encoding="utf-8" ?><List> <Item id="81" country="Japan"></Item> <Item id="852" country="香港特别行政区"></Item> <Item id="886" country="台灣"></Item> 阅读全文
posted @ 2012-08-21 14:36 LitDev 阅读(295) 评论(0) 推荐(0)
C# 类库中跳转页面
摘要:/// <summary> /// 验证用户是否已经登录 /// </summary> public void IsLogin() { if (!SessionIsExistence("userid")) //判断Session是否存在 { System.Web.HttpContext.Current.Response.Write("<script>parent.location.href='" + System.Web.HttpContext.Curre... 阅读全文
posted @ 2012-08-21 14:17 LitDev 阅读(609) 评论(0) 推荐(0)
Asp.net PageDataSource分页
摘要:注:封装数据绑定控件(如 System.Web.UI.WebControls.DataGrid、System.Web.UI.WebControls.GridView、System.Web.UI.WebControls.DetailsView // 和 System.Web.UI.WebControls.FormView)的与分页相关的属性,以允许该控件执行分页操作。无法继承此类。DataListpublic DataTable GetDataSet(string sql) { SqlConnection conn = this.getconn(); ... 阅读全文
posted @ 2012-08-18 18:05 LitDev 阅读(1123) 评论(0) 推荐(0)
Repeater控件中添加删除修改按钮
摘要:1: <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("id") %>' OnClientClick="return confirm('是否删除')" OnClick="Del" >删除</asp:LinkButton>//修改同理2:在后台中添加删除方法 public void Del(object sender,EventArg 阅读全文
posted @ 2012-08-18 18:00 LitDev 阅读(2209) 评论(0) 推荐(0)
Asp.net 处理时间格式
摘要://获取日期+时间DateTime.Now.ToString(); // 2008-9-4 20:02:10DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12//获取日期DateTime.Now.ToLongDateString().ToString(); // 2008年9月4日DateTime.Now.ToShortDateString().ToString(); // 2008-9-4DateTime.Now.ToString("yyyy-MM-dd"); /... 阅读全文
posted @ 2012-08-18 17:58 LitDev 阅读(175) 评论(0) 推荐(0)
C# Cookie操作
摘要:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls; public class Cookie{ /// <summary> /// Cookies赋值 /// </summary& 阅读全文
posted @ 2012-08-18 17:54 LitDev 阅读(2493) 评论(0) 推荐(0)
MS-SQL T-SQL语句查询最近一周的数据
摘要:T-SQL语句:select * from 表 where datediff(week,时间字段,getdate())=0语句中的时间字段就是表中的时间字段getdate(), 查询在当前时间一周内的数据拓展链接:http://yinzhihua2008.blog.163.com/blog/static/7943067200911534335298/ 阅读全文
posted @ 2012-08-18 17:50 LitDev 阅读(1372) 评论(0) 推荐(0)
ASP.NET 非服务器控件绑定数据
摘要:aspx页面:<div>2 <ul class="items">3 <%foreach (System.Data.DataTable dt in fm.GetAll().Table[0]) { %>4 <li><a href='show?id=<%=drPro["id"].ToString() %>'><%=drPro["name"].ToString()%></a></li>5 <% } %>6 & 阅读全文
posted @ 2012-08-18 17:46 LitDev 阅读(205) 评论(0) 推荐(0)
web.config中配置数据库连接字符串
摘要:1.使用windows身份验证连接数据库 <connectionStrings> <add name="ConnStrToSQL" connectionString="Data Source=MYWORLD\SQLEXPRESS2005;Initial Catalog=Myworld;Integrated Security=SSPI;" providerName="SqlServer"/> </connectionStrings>2.使用SQL SERVER身份验证登陆<connectionS 阅读全文
posted @ 2012-08-03 14:59 LitDev 阅读(343) 评论(0) 推荐(0)
MS-SQL中创建索引
摘要:create unique index 索引名称 on 表名 (字段名) 阅读全文
posted @ 2012-08-01 16:02 LitDev 阅读(203) 评论(0) 推荐(0)