开发者

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>
            &nbsp; 
            <div runat="server" id="divTextLink" style="padding-top: 10px;">
                 &nbsp;<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 &nbsp; 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>
    &nbsp; 
    <div runat="server" id="divTextLink" style="padding-top: 10px;">
         &nbsp;<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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜