
ASP.NET
银狐被占用
这个作者很懒,什么都没留下…
展开
-
使DataList控件有翻页功能
使DataList控件有翻页功能 Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。 实现DataList或Repeater控件的分页显示有几转载 2008-06-10 11:40:00 · 707 阅读 · 0 评论 -
给动态数组增加元素
在实际开发中,很多人都会遇到动态数组,无法固定数组的长度,随时需要向数组中增加元素。下面这个函数可以解决以上问题。 /// /// 对数组进行重建并添加新值 /// /// 原数组(string[]) /// 要添加的值 /// 新数组(string[]) public static string[] ArrayResi原创 2011-11-02 14:42:28 · 9663 阅读 · 0 评论 -
GridView数据导入Excel/Excel数据读入GridView
转自清清月儿gridview72绝技导出excelprotected void Button1_Click(object sender, EventArgs e) { Export("application/ms-excel", "学生成绩报表.xls"); } private void Export(string FileType, str转载 2012-02-16 15:17:09 · 634 阅读 · 0 评论 -
GridView控件RowDataBound事件中获取列字段
GridView是ASP.NET中功能强大的数据显示控件,它的RowDataBound事件为我们提供了方便的控制行、列数据的途径。 软件开发网 www.mscto.com 要获取当前行的某个数据列,有如下几种方法: 1. Cells[x].Txt。 从列单元格的文本值获取。这种方法简单高率,最为常用,但是功能单纯。此法存在几个缺点: (1)无法获取到转载 2012-02-16 15:04:53 · 636 阅读 · 0 评论 -
GridView自动求和、求平均值小计
转自清清月儿gridview72绝技,略有改动前台:唯一的花头就是设置ShowFooter="True" private double sum = 0;//取指定列的数据和,你要根据具体情况对待可能你要处理的是intprotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {转载 2012-02-16 15:11:30 · 3596 阅读 · 1 评论 -
批量生成缩略图
using System.IO;using System.Drawing; protected void ThumbnailImage() { string path = Server.MapPath("uploadfile") + "\\"; int width = 84; int height = 64;原创 2012-06-19 14:04:31 · 1059 阅读 · 0 评论 -
jquery+webservice方式的百度搜索下拉提示
default.aspx百度搜索下拉#h_list {background:#EEE;z-index:99;position:absolute;font-size:12px;}#h_list li{list-style-type:none;font-size: 12px;margin:0 0 0 0;padding-l原创 2012-08-23 10:34:26 · 10302 阅读 · 0 评论 -
asp.net汉字转拼音 可返回拼音首字母
调用方法:PinYinClass.GetPinYin("汉字",true);//true返回首字母;false不返回结果:hanzi,hzPinYinClass.csusing System;using System.Text;using System.Collections;using System.ComponentModel;using System.Data;原创 2012-08-27 10:49:32 · 5296 阅读 · 0 评论 -
生成二维码的webservice(可以加logo图片)
最近搞了个生成二维码的webservice,支持中文,都是利用网上的方法,自己组装了一下。组件:ThoughtWorks.QRCode.dllwebservice:using System;using System.Web;using System.Collections;using System.Web.Services;using System.Web.Servic原创 2013-01-06 15:30:28 · 6195 阅读 · 5 评论 -
文件上传:验证文件真实类型并返回文件路径
两个类文件:Adm_FileUpload.cs//*****************************************************using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using原创 2011-11-02 14:59:29 · 1768 阅读 · 0 评论 -
C#生成透明图片
asp.net生成透明图片原创 2011-02-12 09:49:00 · 6078 阅读 · 0 评论 -
正则表达式读取图片地址
using System.Text.RegularExpressions; protected string GetImgUrl(string img) { Regex regex = new Regex(@"", RegexOptions.Compiled | RegexOptions.IgnoreCase ); string str转载 2009-07-18 13:19:00 · 1523 阅读 · 0 评论 -
TreeView树型控件的简单应用
default.aspx//新增TREEVIEW控件,子节点缩进10像素 default.aspx.cs public void TreeInit() { //System.Collections.Specialized.NameValueCollection gb2312 = HttpUtility.ParseQueryString(Re原创 2009-06-01 15:10:00 · 953 阅读 · 0 评论 -
Repeater嵌套Repeater
无缘无故文章失踪了。。只好重新贴一段了。。 .aspx页面部分: " target="_blank">" class="imgt" height="50" src="bbs/files/uploadfaces/" onerror="this.src=bbs/files/uploadfaces/userface/noface.gif;" wid原创 2009-06-06 11:05:00 · 726 阅读 · 0 评论 -
TreeView-无限级树及用户权限的设置
a.aspx 无标题页 function client_OnTreeNodeChecked() { var obj = window.event.srcElement; var treeNodeFound = false; var checkedState; if (obj.tagName == "INPUT" && obj.type == "checkb原创 2009-06-09 15:05:00 · 2041 阅读 · 0 评论 -
仿Google的搜索下拉框
default.aspxhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml" > 无标题页ul,li { list-style:none; margin-left: 1px; margin-bottom:0; padding: 0; border: 0;原创 2009-06-15 13:57:00 · 2411 阅读 · 6 评论 -
Ajax的无刷新树型结构
AjaxTree.aspx http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml" > 无标题页a{ text-decoration:none;}a,a:visited{ color:#000; background:inherit;}bod原创 2009-06-18 09:33:00 · 1668 阅读 · 3 评论 -
AjaxPro.2.dll使用中出现页面未定义错误的解决办法
在使用AjaxPro.2.dll时,web.config中加入: aspx.cs中 “AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));” 注册,但在调用时会出现页面未定义错误。我的解决办法的把命名空间也加上。这样就可以使用了。还有重要的一点:调用js函数时,必须在form内。例://ST_原创 2009-07-07 10:21:00 · 4179 阅读 · 1 评论 -
取农历日期
转自 清清月儿 的农历控件,又按自己的需要增加了星期。显示结果:今天是:2010年12月01日 星期三 农历十月廿六 庚寅(虎)年转载 2010-12-01 11:20:00 · 946 阅读 · 0 评论 -
应用程序模拟登录
界面增加两个button(bt_new,bt_send)和webbrowser(wb_1)以下是实现代码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;u原创 2013-11-27 15:15:40 · 722 阅读 · 0 评论