cannot toggle visibility of usercontrol in side td
I have a usercontrol which I inset in to the page with the following code:
<table id="MainFrame" runat="server" style="border-style: solid; border-width: 0px 3px 3px 3px;table-layout 开发者_Go百科:fixed; width :562px; text-align :center; background-color :White;" cellpadding ="0" cellspacing ="0">
<tr>
<td style="width:5px;"><div style="width:5px;height:10px"></div></td>
<td>
<div runat="server" id="divTextLink" style="padding-top: 10px;">
<Ligdol:TextLink ID="TextLink1" runat="server" Visible="False" />
</div>
</td>
</tr>
In the code-behind I have an if statment which sets the visibility to true.
I put a breakpoint on the line and it's hit, but the visibility does not change.
I tried adding
to the td, but that doesn't help either.
If I put the control outside of the table, everything works as it should.
Edit: The usercontrol code
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TextLinks.ascx.cs" Inherits="NewChannels_Controls_TextLinks" %>
<img style="float: right;" src="/Ligdol/Upload/textlinks.png" />
<asp:HyperLink runat="server" ID="txtLink"></asp:HyperLink>
Change this
<td>
<div runat="server" id="divTextLink" style="padding-top: 10px;">
<Ligdol:TextLink ID="TextLink1" runat="server" Visible="False" />
</div>
</td>
to this
<td style="padding-top: 10px;">
<Ligdol:TextLink ID="TextLink1" runat="server" Visible="False" />
</td>
I can't see no other reason to this not work.
精彩评论