心语飘絮
别让今天的懒惰成为明天的遗憾!!!

随笔分类 -  ASP.NET

1 2 下一页
在Asp.net的HttpCookie中写入汉字,读取时为乱码的解决方法!
摘要:这是因为文字编码而造成的,汉字是两个编码,所以才会搞出这么个乱码出来!其实解决的方法很简单:只要在写入Cookie时,先将其用Url编码,然后再写入,当我们读取时再解码就OK了!Cookie的写入:[代码]Cookie的读取:[代码]这样simple1="你好!";simple2="EnglishisOK!Nothingweshoulddo!"; 阅读全文
posted @ 2008-10-08 17:03 jeffery0101 阅读(258) 评论(0) 推荐(0)
Creating a Custom Pager for GridView(转Bipin Joshi)
摘要:IntroductionThe inbuilt pager of GridView control is limited to only few navigation options (numbers, next-previous etc.). At times you need to customize the pager to suit your applications requiremen... 阅读全文
posted @ 2008-01-02 09:51 jeffery0101 阅读(583) 评论(0) 推荐(0)
去掉按钮上的焦点框
摘要:去掉按钮上的焦点框 阅读全文
posted @ 2007-11-19 08:36 jeffery0101 阅读(681) 评论(1) 推荐(0)
Caching Techniques in ASP.NET 2.0(转)
摘要:Performance is the key requirement of any application. One of important technique which helps in the performance of application is Caching. Caching is the process of storing frequently used data on th... 阅读全文
posted @ 2007-09-09 16:22 jeffery0101 阅读(268) 评论(0) 推荐(0)
全球化(转)
摘要:一、加入全球化信息 在我的网站中,在创建资源文件并加入一些本地化数据后,我首先开始使用显式本地化来设置控件(例如,在我的网站中的标签)的文本,以便它们可以从资源文件中得到它们的值。既然存在四种语言;所以,除一个完全可依赖的资源文件之外(没有本地化命名),我创建了四个资源文件。 注意,这些资源文件都以本地化标记作为它们的中间名称,因此,我需要把UICulture设置为与该本地化相同的名字... 阅读全文
posted @ 2007-09-09 16:19 jeffery0101 阅读(230) 评论(0) 推荐(0)
利用 ASP.NET 的内置功能抵御 Web 攻击(转MSDN)
摘要:发布日期: 4/28/2005 | 更新日期: 4/28/2005 Dino Esposito Wintellect 适用于 Microsoft ASP.NET 1.x Microsoft ASP.NET 2.0 摘要: Dino 总结了最常见的 Web 攻击类型,并介绍了 Web 开发人员可以如何使用 ASP.NET 的内置功能来改进安全性。 本页内容 ... 阅读全文
posted @ 2007-09-04 08:52 jeffery0101 阅读(187) 评论(0) 推荐(0)
Keyboard Shortcut in ASP.NET(转)
摘要:Keyboard shortcuts are well known facility in Windows desktop applications and make application user's life much easier. Although beginners like to use a mouse, that habit usually disappear after some... 阅读全文
posted @ 2007-08-13 17:15 jeffery0101 阅读(341) 评论(0) 推荐(0)
theme变换
摘要:这是根据上篇转载的文章写的事例 :PageBase.cs 1using System; 2using System.Data; 3using System.Configuration; 4using System.Web; 5using System.Web.Security; 6using System.Web.UI; 7using System.Web.UI.WebControls; 8us... 阅读全文
posted @ 2007-07-27 09:24 jeffery0101 阅读(236) 评论(0) 推荐(0)
Recipe: Dynamic Site Layout and Style Personalization with ASP.NET (转)
摘要:Problem: You want to enable end-users visiting your web-site to dynamically customize the look and feel of it. Specifically, you want to enable them to choose different content layouts for the site,... 阅读全文
posted @ 2007-07-26 14:33 jeffery0101 阅读(324) 评论(0) 推荐(0)
27个Asp.Net经常会用到的函数集
摘要:1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curr... 阅读全文
posted @ 2007-06-26 09:50 jeffery0101 阅读(188) 评论(0) 推荐(0)
ASP.NET中常用到的33种方法
摘要:1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数: string a = Request.QueryString("id");string b = Request.Que... 阅读全文
posted @ 2007-06-21 11:18 jeffery0101 阅读(252) 评论(0) 推荐(0)
ICallbackEventHandler接口实现多级联动 (转)
摘要:从一位老兄的Blog上看到了这个,可是代码却不太全(至少我这里看不全)。于是想办法补充了一点:1、客户端脚本: 1 function CallServer() 2 { 3 var product = "测试"; 4 ; 5 } 6 7 function ReceiveServerData(rValue) 8 { 9 alert(rValue);10 window.location.re... 阅读全文
posted @ 2007-05-19 13:23 jeffery0101 阅读(262) 评论(0) 推荐(0)
GridView事件分析 (转)
摘要:P1默认数据绑定过程 编号 事件名称 作用 E1 ... 阅读全文
posted @ 2007-05-19 13:14 jeffery0101 阅读(1771) 评论(0) 推荐(0)
.NET(C#)连接各类数据库
摘要:1.C#连接连接Access程序代码: 1using System.Data; 2 using System.Data.OleDb; 3 .. 4 5 string strConnection="Provider=Microsoft.Jet.OleDb.4.0;"; 6 strConnection+=@"Data Source=C:BegASPNETNorthwind.mdb"; 7 8 ... 阅读全文
posted @ 2007-04-26 09:29 jeffery0101 阅读(250) 评论(0) 推荐(0)
ICallbackEventHandler的一个例子
摘要:前台代码: 1 2 3 4 5 6 ICallbackEventHandler的一个例子 7 8 9 10 11 12 113 214 315 416 517 18 ... 阅读全文
posted @ 2007-04-19 19:25 jeffery0101 阅读(409) 评论(1) 推荐(0)
GridView 如何在翻页时保持CheckBox的选择
摘要:如果你需要在一个GridView中加一个CheckBox,以选择某行数据,然后进入下一页继续选择,而返回上一页时仍旧能够显示你已经选择了的数据行,那么,这里将提供一种方式给你。因为分页时,页面发生变化时,是要postback回服务器的,这样,虽然你做了选择,但是未更新到服务器,所以,不做处理的话是保存不住已经选择的项的。思路:通过一个ArrayList来保持你已经选择的项的ID,当页索引变化时,将... 阅读全文
posted @ 2007-04-19 12:42 jeffery0101 阅读(910) 评论(0) 推荐(0)
直接读取上传文件的内容
摘要:1 2 3 4 5 6 无标题页 7 8 37383940 41 42 43 44 45 46 4748 阅读全文
posted @ 2007-03-16 14:21 jeffery0101 阅读(254) 评论(0) 推荐(0)
Server.Transfer 和Response.Redirect 比较
摘要:如果你读过很多行业杂志和 ASP.NET 示例,你会发现,大多数人使用 Response.Redirect 将用户引导到另一个页面,而另一些人好像偏爱于神秘的 Server.Transfer,那么,这二者有什么区别? Response.Redirect 简单地发送一条消息到浏览器,告诉浏览器定位到另一个页面。你可以使用下面的代码将用户引导到另一个页面: Resp... 阅读全文
posted @ 2007-03-13 13:03 jeffery0101 阅读(223) 评论(0) 推荐(0)
数据库连接
摘要:在Web.config中,数据库连接的种类:1、 1 2 4 前台System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();2、 1 2 3 前台System.Configuration.ConfigurationSettings.AppSett... 阅读全文
posted @ 2007-03-12 19:52 jeffery0101 阅读(211) 评论(0) 推荐(0)
GridView显示空表头
摘要:1 if (ds.Tables[0].Rows.Count == 0)2 {3 AddDummyData(ds);4 } 1 private void AddDummyData(DataSet ds) 2 { 3 4 // Add a dummy row 5 6 Data... 阅读全文
posted @ 2007-03-12 19:42 jeffery0101 阅读(590) 评论(1) 推荐(0)

1 2 下一页