设置自定义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
相关文档:
这两个数据类型是我们在学习C#语言的过程中数据比较难的两个数据类型,不过他们很重要,所以有必要拿出来说说他们的使用方法和不同之处,希望对你有所帮助。
先总的来说:
通常我们向方法中传递的是值.方法获得的是这些值的一个拷贝,然后使用这些拷贝,当方法运行完毕后,这些拷贝将被丢弃,而原来的值不将受到影响.此外我们 ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace TLibrary.ObjectHelper
{
public class CookiesHelper
{
#region ......
今早有个网友问到我这问题,以前我都是直接在数据库中存文件名的,还没有试过存储整张图片到数据库中,上网搜索了一下,自己又测试了一番,代码如下:
建立保存图片的表的SQL语句:
Sql代码 < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://w ......
在Global.asax启动一条线程就ok了,下面是启动线程定时写文件的例子
在Global.asax
C# code:
<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Threading" %>
<script runat="server">
string LogPath;  ......
asp.net 发布网站时有三个选项:
1、允许更新此预编译站点:asp.net web 页面通常包含两个页面,一个即 .aspx 页,还有一个 .aspx.cs 文件,后一个文件是基本委托的事件响应文件代码;此处允许更新此预编译站点的意思就是:.aspx 页可根据需要进行一定的更新,而 .aspx.cs 编译成的 .dll 保持不变;另外,如果发布网站时只 ......