您的位置:首页 > 其它

<table runat="server"> 元素要在增加行TR的TD中内嵌

2008-08-27 14:38 507 查看
<table runat="server" style="width: 800px; font-size:12px; border-collapse:collapse; border:solid 1px #000000; " border="1" id="tblOneyDay" >$g%W+?.^:P.R
<tr> j([$@*c#t/r7K'|
<td style="font-weight: bold; background-color: #ccc; text-align: center; vertical-align: top; height: 17px; width: 61px;">
</td>
<td style="font-weight: bold; background-color: #ccc; text-align: center; vertical-align: top; height: 17px;">
</td>tech.techweb.com.cn-R(d1f+g#u
</tr>%_+j"V$`5c*a ?8p
<asp:Repeater ID="rptOneDay" runat="server">
<ItemTemplate>TechWeb-技术社区"o;r S8m7V%y;P8F
<tr>程序开发,操作系统,服务器,源码下载,Linux,Unix,BSD,PHP,Apach,asp,下载,源码,黑客,安全,技术社区,技术论坛6@,`/[9a4C/|'j2h
<td style="font-weight: bold; background-color: #ccc; text-align: center; vertical-align: top; height: 17px; width: 61px;"><%# DataBinder.Equals(Container.DataItem, "DISPLAYHOUR")%>
</td>
<td style="font-weight: bold; background-color: #ccc; text-align: center; vertical-align: top; height: 17px;"><%# DataBinder.Equals(Container.DataItem, "MEETINGCONTENT_1")%>2]9K M!Y!V!Q
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>

提示出错,编译不过去,
出错原因: TechWeb-技术社区!G2I+s&b-O6U-a.D7|
Error 1 The best overloaded method match for 'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)' has some invalid arguments D:\projects\oneday.aspx 15

去掉runat="server"是客户端html,在服务器中不会编译,即使出现我说的上述元素必须在TD中,但是没有在服务器端编译,所以不会在服务端显式提示.
相反,你添加了,服务端生成HTML过程中会发现我所说的上述错误.

'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)'
用了runat=server,就是服务器控件了,再生成HTML过程中,就发现错误了,显然是再增加行时出现了错误...,也就是元素不在增加行TR的TD中内嵌.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐