{
if(state != null)
{
object[] viewState = (object[])state;
for(int i = 0 ; i < viewState.Length ; i ++)
{
((IStateManager)List[i]).LoadViewState(viewState[i]);
}
}
}
#endregion
}
}
最后,新建一个WEB控件库,名称为:NSWebPanel,以下是源代码:
using System;
using System.Web.UI;
using System.Collections;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace NSWebPanel
{
/// <summary>
/// WebCustomControl1 的摘要说明。
/// </summary>
public class WebCustomControl1 : System.Web.UI.WebControls.WebControl,INamingContainer,IStateManager
{
private const string SCRIPT = "<table id=''''t'''' border=''''1'''' width=''''228'''' height=''''145'''' bordercolor=''''#000000'''' cellspacing=''''0'''' cellpadding=''''0'''' bordercolorlight=''''#000000'''' bordercolordark=''''#FFFFFF''''>\n" +
"<tr>\n" +
"<td width=''''228'''' height=''''20''''>\n" +
"<table border=''''0'''' width=''''100%'''' cellpadding=''''0'''' cellspacing=''''0''''>\n" +
"<tr>\n" +
"<td width=''''10%'''' bgcolor=''''#CCCCFF'''' id=''''sign'''' onmousedown=''''Shink()'''' align=''''center'''' style=''''cursor: hand; font-family: Webdings''''>5</td>\n" +
"<td width=''''90%'''' style=''''font-size:14px''''>\n" +
"<p align=''''center''''>{0}</td>\n" +
"</tr>\n" +
"</table>\n" +
"</td>\n" +
"</tr>\n" +
"<tr id=''''downBlock''''>\n" +
"<td width=''''228'''' height=''''113''''>\n" +
"<table border=''''0'''' cellpadding=''''0'''' cellspacing=''''0'''' width=''''100%'''' height=''''106'''' style=''''font-size:14px''''>\n" +
"<tr>\n" +
"<td width=''''100%'''' align=''''center'''' height=''''21'''' id=''''tr1''''><a target=''''_blank'''' href=''''{6}''''>{1}</a></td>\n" +
"</tr>\n" +
"<tr>\n" +
"<td width=''''100%'''' align=''''center'''' height=''''21'''' id=''''tr2''''><a target=''''_blank'''' href=''''{7}''''>{2}</a></td>\n" +
"</tr>\n" +
&n 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 [C语言系列]NET 中C#的switch语句的语法 [系统软件]托拽Explore中的文件到VB.net的窗口 [系统软件]Boost库在XP+Visual C++.net中的安装 [常用软件]新配色面板:Paint.Net3.0RC1官方下载 [常用软件]用内建的“Net Meeting”聊天 [VB.NET程序]Henry的VB.NET之旅(三)—共享成员 [VB.NET程序]Henry的VB.NET之旅(二)—构造与析构 [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体 [VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET) [VB.NET程序]Henry手记-VB.NET中动态加载Treeview节点(二)
|