我在formview中有一个sqldatasourece控件和formview控件,我有一个看不见的占位符。如果文本框(在同一个formview中)的值为“yes”,我想让占位符可见。
<asp:TextBox ID="Load_SystemsTextBox" runat="server"
Text='<%# Bind("Load_Systems") %>' />
<asp:PlaceHolder ID="PlaceHolderItem3Yes" runat="server" Visible="False">
the value returned from the database equals yes
</asp:PlaceHolder>
我正试图让占位符在后面的cobe中可见但是下面的剂量工作
PlaceHolder PlaceHolderItem3Yes = (PlaceHolder)Master.FindControl("PlaceHolderItem3Yes");
TextBox Load_SystemsTextBox = (TextBox)FormView2.FindControl("Load_SystemsTextBox");
if (Load_SystemsTextBox.Text == "YES")
{
PlaceHolderItem2Yes.Visible = true;
}
else
{
PlaceHolderItem2Yes.Visible = false;
}