简单教程
提交运行
代码编辑器:
<script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) if check1.Checked then panel1.Visible=false else panel1.Visible=true end if End Sub </script> <!DOCTYPE html> <meta charset="utf-8" /> <form runat="server"> <asp:Panel id="panel1" runat="server" BackColor="#ff0000" Height="100px" Width="100px"> Hello World! </asp:Panel> <asp:CheckBox id="check1" Text="Hide Panel control" runat="server"/> <br><br> <asp:Button Text="Reload" runat="server" /> </form>
运行结果: