编辑您的代码:提交代码

x
 
1
 
2
 
3
4
<code class="jscode"><script  runat="server">
5
Sub Page_Load(sender As Object, e As EventArgs)
6
   if check1.Checked then
7
     panel1.Visible=false
8
   else
9
     panel1.Visible=true
10
   end if
11
End Sub
12
</script></code>
13
14
<html>
15
<body>
16
17
<form runat="server">
18
<asp:Panel id="panel1"
19
runat="server" BackColor="#ff0000"
20
Height="100px" Width="100px">
21
Hello World!
22
</asp:Panel>
23
<asp:CheckBox id="check1"
24
Text="隐藏 Panel 控件"
25
runat="server"/>
26
<br /><br />
27
<asp:Button Text="重新加载" runat="server" />
28
</form>
29
30
</body>
31
</html>
32
            

查看结果:

请在上面的文本框中编辑您的代码,然后单击提交按钮测试结果。w3c0.com

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号