设置自定义ASP.NET服务器控件TagPrefix的几种方法
这两天看《道不远人-----深入解析ASP.NET2.0控件开发》这本书,看完第二章内容后,想总结下“设置自定义ASP.NET服务器控件TagPrefix的几种方法”,以便以后查阅,以下面code编写的控件为例,由于重点不是控件编写,所以写了个非常简单的控件,姑且叫它EmailInput
Code
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Text;
5using System.Web;
6using System.Web.UI;
7using System.Web.UI.WebControls;
8
9namespace ServerControl
10{
11 [ToolboxData("<{0}:EmailInput runat=server></{0}:EmailInput>")]
12 public class EmailInput : CompositeControl
13 {
14 protected RegularExpressionValidator _regValidator;
15 protected RequiredFieldValidator _rqrValidatator;
16 protected TextBox _input;
17 protected override HtmlTextWriterTag TagKey
18 {
19 get
20 {
21 return HtmlTextWriterTag.Div;
22 }
23 }
24 protected override void CreateChildControls()
25 {
26 Controls.Clear();
27
相关文档:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace TLibrary.ObjectHelper
{
public class CookiesHelper
{
#region ......
整数或者小数:^[0-9]+\.{0,1}[0-9]{0,2}$
只能输入数字:"^[0-9]*$"。
只能输入n位的数字:"^\d{n}$"。
只能输入至少n位的数字:"^\d{n,}$"。
只能输入m~n位的数字:。"^\d{m,n}$"
只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。
只能输入有两位小数的正实数:"^[0-9]+(.[0-9]{2})?$"。
只能输入有1~3位小数的 ......
基于功能更丰富的基础类构建您自己的 ASP.NET 页面
发布日期 : 11/4/2004 | 更新日期 : 11/4/2004
Dino Esposito
Wintellect
适用范围:
Microsoft ASP.NET
Microsoft ASP.NET 2.0
摘要:通过继承可以在通用 Microsoft ASP.NET 类(例如 Page 类)中添加功能。这为您提供了一个公共场所,使您可以添加功能并将功能部 ......
在Global.asax启动一条线程就ok了,下面是启动线程定时写文件的例子
在Global.asax
C# code:
<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Threading" %>
<script runat="server">
string LogPath;  ......