日期:2014-05-16 浏览次数:20467 次
<%@ 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>
------解决方案--------------------
http://topic.csdn.net/u/20120319/13/6c1074a6-e77d-4b6e-a750-830617eda782.html