
Asp.net
聖傑
醉看流霞远走天涯一片淡紫色的牵挂
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Repeater控件实现数据绑定,并实现分页效果
前台显示代码 <table style="width: 100%; text-align: center; height: 102px; font-size: small;" align="center" rules="all"> 姓名原创 2012-08-30 08:58:36 · 4416 阅读 · 0 评论 -
#if #elif #endif 的使用--------条件编译(conditional compilation)
使用 #if 以及 #else、#elif、#endif、#define 和 #undef 指令,可以包括或排除基于由一个或多个符号组成的条件的代码一般条件编译用于你在调试的时候,需要输出结果来确定程序是否正确,但在发布的时候不需要输出这些结果。或者程序在某一版本发布了一个试用的功能,但在下一版本中要暂时去掉这个功能,就可以这个条件来控制。#define DEBUG原创 2014-01-03 22:13:00 · 1191 阅读 · 0 评论 -
C#数据库查询的基本步骤(Sql Server)
连接字符串。一般定义在项目的web.config文件中。原创 2013-10-26 18:26:19 · 7240 阅读 · 0 评论 -
Linq To XML 查询,并转换为Datatable
查询的xml 2 0 0 出勤 出勤 2 0 1 出勤 缺勤 第一种方法:string path = xmlpath+classname + ".xml"; XElement root = XEleme原创 2013-05-04 09:18:52 · 1785 阅读 · 0 评论 -
Excel2003,2007,2010,2013导入导出sqlserver
添加Microsoft.Office.Interop.Excel引用。ExcelIO类:using System;using System.Data;using System.Data.OleDb;//using System.Collections.Generic;//using System.Text;using Excel = Microsoft.Office.Intero原创 2013-03-28 15:25:59 · 3023 阅读 · 0 评论 -
C#实现对指定文件夹中文件按修改时间排序
string path = "~/Document/Introduction/团队管理制度/"; DirectoryInfo dirinfo = new DirectoryInfo(Server.MapPath(path)); FileInfo[] Files = dirinfo.GetFiles(); Array.So原创 2012-10-17 10:20:11 · 5550 阅读 · 0 评论 -
GridView动态添加模板列
1、首先添加一个模板类using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace NSDPWeb.DbAccess.Introduction{ /转载 2012-09-21 17:25:41 · 711 阅读 · 0 评论 -
GridView表头固定,表体滚动效果
网上搜到的用CS方法,效果不好。实现原理。1、新建一个table,只显示表头。(同理也可以新建一个GridView,添加一列空行,然后隐藏行,即可只显示表头)2、隐藏GridView的表头(ShowHeader="false");3、控制width实现对齐。 <table align="center" rules="all" s原创 2012-10-10 21:20:44 · 1565 阅读 · 0 评论 -
关于Dropdownlist绑定GridView分页出错问题
问题描述:我通过Dropdownlist来同步刷新GridView中数据,默认绑定的GridView有5页(PageSize=12)数据。当我选择Dropdownlist的第一项时,查询到两页数据,并绑定到GridView。GridView中显示的也是两页。当我点击第二页时,问题出现了。数据由2页变成了5页。我的整个页面都用的UpdatePanel包裹着的。问题探讨:原创 2012-09-17 11:03:24 · 904 阅读 · 0 评论 -
后台动态添加超链接实现点击文件实现下载
protected void Page_Load(object sender, EventArgs e){string path = "~/Document/Introduction/团队管理制度/";DirectoryInfo dirinfo = new DirectoryInfo(Server.MapPath(path));FileInfo[] Files = dirinfo.GetF原创 2012-09-15 09:55:18 · 4104 阅读 · 0 评论 -
Dropdownlist的SelectedChanged事件未触发处理办法。
Dropdownlist设置AutoPostBack=true原创 2012-09-12 13:17:29 · 743 阅读 · 0 评论 -
DateTime为空解决办法
if(birthday=="")sqlparas[6]=new sqlparas("@birthday",DBNull.value);elsesqlparas[6]=new sqlparas("@birthday",birthday);原创 2012-08-30 08:48:38 · 4485 阅读 · 0 评论 -
后台代码动态添加控件并自动换行
Literal literal=new Literal();literal.Text="";panel1.controls.Add(literal);Hyperlink hyperlink=new Hyperlink();panel1.controls.Add(hyperlink);原创 2012-08-30 08:44:18 · 2148 阅读 · 0 评论 -
Collections你用对了吗?
.Net有两类基础的集合类型:List和Dictionary。List是基于Index的,Dictionary是基于key的。集合类型一般实现了IEnumberable,ICollection或者Ilist接口。 类型描述使用场景ArrayList能够根据添加项动态调整集合大小。适用于存储自原创 2014-06-23 21:57:36 · 1130 阅读 · 0 评论