





ASP.NET 开发方面的一些有必要知道的很有用技巧的合集. 试着翻译一下, 有些东西没有办法表达就没有翻译. 下面的内容有些可能是多余的, 反正自己感觉是鸡肋.
原文标题: ASP.NET Hacks
原文地址: http://wiki.lessthandot.com/index.php/ASP.NET_Hacks
This is a collection of ASP.NET hacks (i.e. tips and tricks) and includes some useful to know things about ASP.NET development.
We will split them up into the following categories:
* ASP.NET: Environment Details 应用程序详细的环境信息(IIS 服务器上) * ASP.NET: Encrypt your applications settings 加密 Web.Config 内的设置 * ASP.NET: Launch an external application 运行外部程序(感觉 ASP.NET 上用不到, 如果执行也会执行服务器行为. 另外还得考虑当前ASP.NET用户权限方面) * ASP.NET: Display Version Information 显示版本信息
* ASP.NET: Clear all Cached objects 清除所有缓存对象 * ASP.NET: Data Caching 数据缓存
* ASP.NET: Access Master Page controls from the Content Page 内容页访问母版页空间 * ASP.NET: Maintain an entered password in a TextBox 保持 TextBox 文本框控件已输入的密码 * ASP.NET: Apply a Please Wait message to a Button 给 Button 按钮控件应用一个等待提示 * ASP.NET: Clear all TextBox values 清空所有 TextBox 文本框控件的值 * ASP.NET: Creating an accessible label 创建可关联的 Label 控件 * ASP.NET: Add dynamic controls with events 动态控件添加事件 * ASP.NET: Get a list of all selected items in a CheckBoxList 得到所有CheckBoxList 复选框列表控件的选择项 * ASP.NET: Find which control caused a postback 看看哪一个控件发起的页面回调 * ASP.NET: Limit selections for the Calendar 限制 Calendar 日历控件的选择范围 * ASP.NET: Add a confirmation popup to a Button 给 Button 按钮控件追加确定提示 * ASP.NET: Insert a ListItem into a DropDownList 向 DropDownList 下拉列表控件插入 ListItem 项 * ASP.NET: Add paging to a repeater 给 Repeater 重复控件分页 * ASP.NET: Append client side functions with Attributes.Add 使用 Attributes.Add 向某控件追加客户端函数 * ASP.NET: Add a total row to a GridView 给 GridView 网格控件添加一个汇总行 * ASP.NET: How to export a GridView to Excel 怎样导出 GridView 网格控件数据到 Excel * ASP.NET: Render a control to a string 将控件渲染到字符串
* ASP.NET: Convert a DataSet to a DataView 把 DataSet 转换成 DataView * ASP.NET: Extract data from a SQLDataSource to a DataTable 从 SQLDaraSource 中获取数据到一个 DataTable 中 * ASP.NET: Insert data into SQL Server 往 SQL Server 数据库中插入数据 * ASP.NET: Loop through data in a DataTable 使用 DataTable 来遍历数据 * ASP.NET: Loop through data using a DataReader 使用 DataReader 来遍历数据 * ASP.NET: Storing connection strings in the web.config file 在 Web.Config 文件中存储数据库连接字符串
* ASP.NET: Calculate a person's age from their date of birth 根据某人生日计算其年龄 * ASP.NET: Calculate the difference between two dates 计算两个日期之间的差值 * ASP.NET: Simple date and time methods 简单的时间和日期的处理方法
* ASP.NET: Enabling page tracing 打开页面跟踪 * ASP.NET: Simple debugging tips 简单的调试技巧
* ASP.NET: Send an email ASP.NET 发邮件
* ASP.NET: Encrypt a string using MD5 使用 MD5 加密字符串
* ASP.NET: Files and Path information 获取某个文件或路径信息 * ASP.NET: Rename a directory 重命名某个目录 * ASP.NET: Reference files with relative paths 使用相对路径来引用文件 * ASP.NET: Read and display a text file 读取和显示文件文件
* ASP.NET: How to crop an Image 创建图像缩略图 * ASP.NET: How to save a remote image 怎样保存远程的图像 * ASP.NET: Drawing images and bar charts with System.Drawing 使用 System.Drawing 绘制图像或者图表
* ASP.NET: Register a javascript function 往页面注册一个 javascript 函数
* ASP.NET: Accessing the Response object in a Class 在某个类中访问 Response 对象 * ASP.NET: Defining Imports 定义默认命名空间导入 * ASP.NET: An introduction to classes and properties 类和属性的一些说明 * ASP.NET: Looping using an Enumerator 使用迭代器来循环 * ASP.NET: Use Response.Filter to intercept your HTML 使用 Respose.Filter 来拦截 HTML * ASP.NET: Use C Sharp and VB.NET in the same project 在同一个项目中同时使用 C# 和 VB.NET * ASP.NET: Using Generics to create a property list 使用泛型来传来属性列表
* ASP.NET: Change the current Master Page 切换当前母版页 * ASP.NET: Nested Master Pages 嵌套母版页
* ASP.NET: Redirect the page when the session ends 回话结束跳转到指定页面
* ASP.NET: Filter words 单词过滤 * ASP.NET: Remove the last character from a string 删除字符串默认字符 * ASP.NET: Reverse a string 颠倒字符串 * ASP.NET: String Concatenation 字符串连接 * ASP.NET: Strip HTML tags from a string 剔除字符串中的 HTML 标签 * ASP.NET: Truncate a string to a set number of whole words 截断字符串指定数目的整词
* ASP.NET: Using Page.IsValid 使用 Page.IsValid
* ASP.NET: Changing the default browser 更改 VS 默认浏览器 * ASP.NET: Keyboard Shortcuts VS 键盘热键 * ASP.NET: Using a task list 使用 VS 任务列表
* ASP.NET: Access the web via a proxy server 通过代理服务器访问 Web * ASP.NET: Convert HTML tables to a DataSet 把 HTML 表格转化成 DataSet * ASP.NET: Retrieve data from a web page 从一个 Web 页面取回数据 * ASP.NET: Create an RSS Feed 创建 RSS 聚合 * ASP.NET: Custom Error Pages 自定义页面错误 * ASP.NET: Find out where a visitor came from 找出访客的来源 * ASP.NET: Using an AppOffline.htm file for updates 使用 AppOffline.htm 文件表示站点更新中 * ASP.NET: XHTML Strict Validation XHTML 规范严格验证
小郑不再“宅”了,改当游民了。回来这么多天,似乎天天都出去跑,不像过去每天都呆宿舍里不出去。不过这样也好,让我重归人世了,跑一跑人也健康。
上午和阿猪去把驾驶证考试报名的事办了。他舅舅开了个驾校,和我老爹是同学,最后硬是不肯收钱。有熟人就是方便,报名加体检十几分钟就弄好了,最后拿了本书回来让我看,说是星期六早上去驾校笔试,下周三去交警那机试。
赶紧把驾照一考,然后出国~~~
下午让阿猪组织些人出来玩~~
<你的误区>和<二十岁决定女人的一生>两本书里都提到过要勇于尝试和改变!
而自己也说过,其实很多人都有心要勇于尝试和改变,但是都不会付诸行动.因为,在他们看来,尝试和改变所蕴含的风险和不确定的因素远远要高于墨守陈规和保持现状.也可以说,驱使你做出尝试和改变的动力远远不足.
一直以来,从搬到这里住,我一直坚持着一条上班线路:
走路10分钟,坐一路公交车1个半小时,再步行15分钟到达公司.为什么乐此不疲(事实上很疲倦)?(两个小时)
因为,不需要转车!因为一旦转车,中间就有着很多不确定的因素,诸如错过了下一班,你不得再等上十几分钟.或者,你转车肯定还需要再多走一段路程等等.而我却忽视了,在一趟公交车上,因为堵车而造成的时间浪费.
记得有一天,我真的很想改变一下上班的路线,第二天,却依然没有勇气做出改变!因为,你不确定你改变了路线之后,会发生些什么事情!
直到今天,我终于做出了尝试和改变:
步行20分钟到公交车站;10分钟等车;20分钟公交车;步行到地铁站5-8分钟;转换地铁一共30分钟.
尽管今天在这辆热线公交车上被挤的很不开心,但是却心想:这么多人都是这样挤过来的.自己为什么就不能忍受一下呢?
包里装了太多的东西,公交车上显然是无法看书,因为太挤也因为不稳.
但是,到了地铁上,我完全可以把书拿出来看,因为地铁很稳,而且不是那种挤的跟饼一样的程度.
还有一点,以前自己一个人坐公交车,没有感受到上班族的强大!
但是,当你从一辆公交车上挤下来,你发现身边周遭还有无数人跟你一样,走一样的线路,一样匆忙的脚步,你突然觉得自己并不孤单.
做出这个尝试当然也是需要付出代价的:
你必须要穿旅游鞋或者平底的舒服的鞋子,因为只有这样你才不会感觉到累,因为这一路上你都不会有坐下来的机会!
所以,今天的尝试和改变是值得的!
这虽然是一件很小的事情,但对我的影响很大,我不仅可以比平时少用半个小时的时间上班,也可以找到在这个陌生城市里的一点归属感,更因为,我做出了尝试和改变.
今后的路也是一样,人生会有太多的十字路口,丁字路口,如果你觉得是时候要改变了,或者你有着这种冲动,那么千万不要把这种念头和冲动消磨掉,打发掉.将这种冲动变为现实吧,因为到时候你会发现,你所做出的改变是多么有价值的!
重新引用鲁冠球的一段话:
一天做一件实事;
一个月做一件新事;
一年做一件大事;
一辈子做一件有意义的事;