login.aspx

来自「用VB实现」· ASPX 代码 · 共 90 行

ASPX
90
字号
<%@ Page Language="VB" ContentType="text/html"  %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet 
id="dsAdmin"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_cnn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_cnn") %>'
CommandText='<%# "SELECT *  FROM Admin WHERE adm_ID = ? AND adm_Pwd = ?" %>'
Debug="true"
>
  <Parameters>
    <Parameter  Name="@adm_ID"  Value='<%# txtID.text %>'  Type="WChar"   />
    <Parameter  Name="@adm_Pwd"  Value='<%# txtPWD.Text %>'  Type="WChar"   />
  </Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<%
  Session("AdminID") = ""
  IF dsAdmin.RecordCount > 0 THEN 
    Session("AdminID") =  txtID.Text 		
    Response.Redirect("theMessage.aspx") 
  END IF   
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录管理界面</title>
<style type="text/css">
<!--
.style1 {
	font-size: large;
	font-weight: bold;
}
.style2 {font-weight: bold}
-->
</style>
</head>
<body>
<form action="" method="post" name="form1" runat="server">
  <div align="center">
    <table width="299"  border="0">
      <tr>
        <td height="7" colspan="2"><div align="center" class="style1">信息公告系统管理登录</div></td>
      </tr>
      <tr>
        <td height="8" colspan="2"><hr></td>
      </tr>
      <tr>
        <td height="27"><div align="right" class="style2">
          用户名</div></td>
        <td width="215">
            <div align="left">
            <asp:TextBox ID="txtID" runat="server" />            </div></td>
      </tr>
      <tr>
        <td height="20"><div align="right"><span class="style2">密码</span></div></td>
        <td>
            <div align="left">
              <asp:TextBox ID="txtPWD" runat="server" TextMode="Password" />            
              <asp:Button ID="btnLogin" Text="登录" runat="server" />            
            </div></td>
      </tr>
      <tr>
        <td height="23" colspan="2"><div align="right" class="style2"></div>        
          <div align="center">
            <hr>
          <a href="theMessage.aspx"><strong>回到信息公告列表</strong></a><strong>       </strong></div></td>
        </tr>
      <tr>
        <td height="17" colspan="2"><hr></td>
        </tr>
      <tr bgcolor="#FFFFFF">
        <td height="17" colspan="2">        <div align="center" class="style3"></div></td>
        </tr>
  
          <MM:If runat="server" Expression='<%# (dsAdmin.RecordCount = 0 and IsPostBack) %>'>
            <ContentsTemplate>
              <tr bgcolor="#FF0000">
                  <td height="17" colspan="2"><div align="center" class="style3">登录失败,请重新输入!</div></td>
              </tr>
            </ContentsTemplate>
           </MM:If>	
    </table>
  </div>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?