我想创建一个封装以下控件的控件:
我已经重新创建了 HTML(请原谅丑陋的表格使用,直到我用 div 和 CSS 清理它),就像在控制 .ascx 文件中一样:
<%@ Control Language="VB" AutoEventWireup="false"
CodeFile="MultiLevelReportFilter.ascx.vb"
Inherits="controls.MultiLevelReportFilter" %>
<%@ Register TagPrefix="cc1" Namespace="UNLV.IAP.WebControls"
Assembly="DropDownCheckList" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
<title></title>
<style type="text/css">
/*<![CDATA[*/
tr.c2 {display: none;}
td.c1 {font-weight: bolder; color: Red; font-size: 10pt;}
/*]]>*/
</style>
</head>
<body>
<table width="98%" cellspacing="0" cellpadding="15" align="center">
<tr>
<td width="40%" valign="top">
<table width="600" cellspacing="0" cellpadding="4">
<tr>
<td colspan="2" class="txtLabel c1" align="center">Sales as of</td>
</tr>
<tr>
<td align="right" class="txtLabel" width="200">Period </td>
<td class="txtLabel" width="400"></td>
</tr>
<tr class="c2">
<td align="right" class="txtLabel" width="200">Year </td>
<td class="txtLabel" width="400"> Month </td>
</tr>
<tr>
<td align="right" class="txtLabel" width="200">Accounts Filter </td>
<td></td>
</tr>
<tr>
<td align="right" class="txtLabel" width="200">Brands Filter </td>
<td></td>
</tr>
<tr id="Tr1" runat="server" visible="false">
<td align="right" valign="top" class="txtLabel" width="200">Business
Groups</td>
<td></td>
<td></td>
</tr>
<tr>
<td align="right" valign="top" class="txtLabel" width="200">Measurement</td>
<td> <span class="txtLabel">Display</span> </td>
<td></td>
</tr>
</table>
</td>
<td width="60%" valign="top">
<table width="200">
<tr>
<td width="20"><img src="/images/ico_graph1.gif" runat="server" id=
"iGenerate" /></td>
<td width="180">Generate Report</td>
</tr>
<tr>
<td width="20"><img src="/images/ico_print.gif" runat="server" id=
"iPrint" /></td>
<td width="180">Print</td>
</tr>
<tr>
<td width="20"><img src="/images/ico_excel.jpg" runat="server" id=
"iExport" /></td>
<td width="180">Export To Excel</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
我的问题有两个:
如何将其包含在另一个页面上?
我试图注册我的控件并引用它,但我错过了大会信息。我似乎找不到有关如何在程序集中注册控件的任何信息:
<%@ Register TagPrefix="cc1" Namespace="Controls.MultiLevelReportFilter"
Assembly="MultiLevelReportFilter" %>
Visual Studio 在上面的行中报告错误,因为程序集不正确。
从另一个页面调用它时是否可以隐藏某些控件?