您的位置:首页 > 编程语言 > ASP

[转摘翻译]ASP.NET 技巧合集

2020-03-01 17:21 525 查看

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:

Contents 内容

Applications

* 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 显示版本信息

Caching

* ASP.NET: Clear all Cached objects 清除所有缓存对象
* ASP.NET: Data Caching 数据缓存

Controls

* 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 将控件渲染到字符串

Database

* 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 文件中存储数据库连接字符串

Dates

* 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 简单的时间和日期的处理方法

Debugging

* ASP.NET: Enabling page tracing 打开页面跟踪
* ASP.NET: Simple debugging tips 简单的调试技巧

Email

* ASP.NET: Send an email ASP.NET 发邮件

Encryption

* ASP.NET: Encrypt a string using MD5 使用 MD5 加密字符串

Files

* 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 读取和显示文件文件

Images

* 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 绘制图像或者图表

Javascript

* ASP.NET: Register a javascript function 往页面注册一个 javascript 函数

Objects and Classes

* 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 使用泛型来传来属性列表

Pages

* ASP.NET: Change the current Master Page 切换当前母版页
* ASP.NET: Nested Master Pages 嵌套母版页

Sessions

* ASP.NET: Redirect the page when the session ends 回话结束跳转到指定页面

Strings

* 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 截断字符串指定数目的整词

Validation

* ASP.NET: Using Page.IsValid 使用 Page.IsValid

Visual Studio

* ASP.NET: Changing the default browser 更改 VS 默认浏览器
* ASP.NET: Keyboard Shortcuts VS 键盘热键
* ASP.NET: Using a task list 使用 VS 任务列表

Web

* 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 规范严格验证

转载于:https://www.cnblogs.com/Luna/archive/2008/09/05/1284942.html

  • 点赞
  • 收藏
  • 分享
  • 文章举报
AD2096 发布了0 篇原创文章 · 获赞 0 · 访问量 70 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: