login.aspx

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

ASPX
84
字号
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ 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_conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_conn") %>'
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("newPaperList.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>
<div align="center">
<form runat="server">
  <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 align="right">用户名</div>
      </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="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>
  </form>
</div>
</body>
</html>

⌨️ 快捷键说明

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