<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function show() {
document.getElementById("div").style.display = "block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="div" style="display:none">用户名:<asp:TextBox ID="name" runat="server" Width="70px" MaxLength="20"></asp:TextBox></div>
<asp:Button runat="server" Text="显示" ID="btn" OnClientClick="show()" />
</div>
</form>
</body>
</html>显示 时马上又隐藏了,我只单击了一下,请指教
外层是隐藏的
这样试试<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function show() {
document.getElementById("div").style.display = "block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="div" style="display:none">用户名:<input type='text'/></div>
<input type='button' onclick="show()" />
</div>
</form>
</body>
</html>
应该是你做了别的处理吧。。