条件付きで表示するには、このasp:TableRowが必要です。
<asp:TableRow>
<asp:TableCell><asp:Label id="ExtraAmountType" runat="server" Width="182px"></asp:Label></asp:TableCell>
<asp:TableCell Width="10%" HorizontalAlign="Right">$ <asp:textbox id="MembershipDues" runat="server" Wrap="False" BackColor="#FFFF80" AutoPostBack="True" Width="31px" MaxLength="3" ontextchanged="MembershipDues_TextChanged"></asp:textbox></asp:TableCell>
</asp:TableRow>
これどうやってするの。私はそれを包んだ
<asp:PlaceHolder ID="memberdues" runat="server">
タグが文句を言う:
エラー12System.Web.UI.WebControls.TableRowCollectionには、「System.Web.UI.WebControls.TableRow」タイプのアイテムが必要です。「asp:PlaceHolder」のタイプは「System.Web.UI.WebControls.PlaceHolder」です。
条件付きで表示するには、この行が必要です。
私はPage_Loadでこれを行います:
memberdues.Visible = false;
if (DuesInfo.CredentialsAmount > 0)
{
// do some other stuff to populate the variables in the placeholder then show it
memberdues.Visible = true;
}