WebForm写登陆界面
今天学习了一点WebForm的知识,我觉着和WinForm没多大差别。。。都可以拖控件。。webform的空间可以和有两个登录按钮 一个是直接拖的控件 一个是用<From>中的<input>生成的。。。其实他俩代码都差不多一样。。。只不过直接拖的控件被高度封装了
今天做了个登陆界面
.aspx页。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="denglu.aspx.cs" Inherits="denglu" %>
<!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">
<style type="text/css">
.tb
{ border:1px double blue;
margin:0 auto;
}
</style>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" class="tb">
<tr>
<td class="style1">用户名:</td><td class="style1">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>密码:</td><td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="登陆" onclick="Button1_Click" />
<input type="button" runat="server" value="HTML登陆" onserverclick="Button1_Click" />
</td><td> <label id="lb" runat="server"></label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
.cs页中
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="denglu.aspx.cs" Inherits="denglu" %>
<!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">
<style type="text/css">
.tb
{ border:1px double blue;
margin:0 auto;
}
</style>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" class="tb">
<tr>
<td class="style1">用户名:</td><td class="style1">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>密码:</td><td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="登陆" onclick="Button1_Click" />
<input type="button" runat="server" value="HTML登陆" onserverclick="Button1_Click" />
</td><td> <label id="lb" runat="server"></label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>