Login.aspx.cs

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string user_name = this.Login1.UserName.Trim();
        string pass_word = this.Login1.Password.Trim();
        if (!Dao.login(user_name,pass_word))
        {
            return;
        }
        Session["user_name"] = user_name;
        Response.Redirect("~/Index.aspx");
    }
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Hotel.WebForm1" EnableEventValidation="false" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <link rel="stylesheet" href="Assets/Libraries/Bootstrap/css/bootstrap.min.css" /> <style> body{ background-image:url(../Assets/Images/hotel4.jpg); background-size:cover; } .container-fluid{ opacity:0.9; } </style> </head> <body> <form id="form1" runat="server" > <div> <div class="container-fluid"> <div class="row" style="height:200px"></div> <div class="row"> <div class="col-md-4"></div> <div class="col-md-4 bg-light rounded-3"> <h1 class="text-text-success text-center">皇家理工度假酒店</h1> <form> <div class="mb-3"> <label for="UserTb" class="form-label">用户名</label> <input type="text" class="form-control" id="UserTb" runat="server" required="required"> </div> <div class="mb-3"> <label for="PasswordTb" class="form-label">密码</label> <input type="password" class="form-control" id="PasswordTb" runat="server" required="required"> </div> <div class="mb-3"> <label id="ErrMsg" class="text-danger" runat="server"></label> <input type="radio" id="AdminCb" runat="server" name="Role"><label class="text-success">管理员</label> <input type="radio" id="UserCb" runat="server" name="Role"><label class="text-success">用户</label> </div> <div class="d-grid"> <asp:Button ID="LoginBtn" runat="server" Text="登陆" class="btn btn-success btn-block" OnClick="LoginBtn_Click" /> </div> <br /> </form> </div> <div class="col-md-4"></div> </div> </div> </div> </form> </body> </html>我在form中添加了align=center属性但是删除后却依旧运行了原先配置
最新发布
05-27

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值