我希望能用javascript控制Panel的隐藏与显示问题是这样:为什么第一次点击Checkbox1时Panel1就隐藏了,但是不管我再点多少次,Panel都不能在重新现实呢?代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="a.aspx.cs" Inherits="a" %><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function Checkbox1_onclick()
{
if (document.all.Checkbox1.Checked)
{document.all.Panel1.style.display='';}
else
{document.all.Panel1.style.display='none';}
}
</script>
</head>
<body>
<input id="Checkbox1" type="checkbox" onclick="return Checkbox1_onclick()" /><br />
<asp:Panel ID="Panel1" runat="server" Height="269px" Width="553px">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></asp:Panel>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="a.aspx.cs" Inherits="a" %><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function Checkbox1_onclick()
{
if (document.all.Checkbox1.Checked)
{document.all.Panel1.style.display='';}
else
{document.all.Panel1.style.display='none';}
}
</script>
</head>
<body>
<input id="Checkbox1" type="checkbox" onclick="return Checkbox1_onclick()" /><br />
<asp:Panel ID="Panel1" runat="server" Height="269px" Width="553px">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></asp:Panel>
</body>
</html>
解决方案 »
- 生成 Excel 文件 ArgumentException: 不支持 URI 格式 问题
- 我做了一个小型的门户网站 需要写缓存!
- ajax 控件Accordion没有效果
- 网页播放视频文件的问题....
- 如何定义在datalist绑定列文本框中的回车事件?急!
- 字符格式化问题
- 能不能給兄弟介紹一個好點asp.net的論壇,
- 如何反编译vs2005的dll文件
- 如何才能实现这种效果,就是点击按钮后,整个网页都不能操作了(鼠标点到任何地方都不法操作,但可以看)
- 字符串的问题。。。
- 发邮件的这段代码有什么错误啊?
- 无法将类型“object”隐式转换为“System.Data.DataView”。存在一个显式转换(是否缺少强制转换?)
if (document.all.Checkbox1.Checked)=>>if (document.all.Checkbox1.checked)
http://topic.csdn.net/t/20030122/20/1384486.html