asp.net58同城简单登陆

asp.net58同城简单登陆界面

以asp.net来设计的一个登陆
1.comfing连接自己需要的数据库(自行设计)
2.搭建三层架构

asp.net58同城简单登陆
3.界面设计
<%@ Page Language=“C#” AutoEventWireup=“true” CodeBehind=“58TCDemo.aspx.cs” Inherits=“WebUI2._58TCDemo” %>

asp.net58同城简单登陆











4.后台代码 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;

namespace WebUI2
{
public partial class _58TCDemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//手机号
txtPhone.Attributes.Add(“Value”, “手机号”);
txtPhone.Attributes.Add(“OnFocus”, “if(this.value==‘手机号’) {this.value=’’}”);
txtPhone.Attributes.Add(“OnBlur”, “if(this.value==’’){this.value=‘手机号’}”);

        //验证码
        txtYZM.Attributes.Add("Value", "验证码");
        txtYZM.Attributes.Add("OnFocus", "if(this.value=='验证码') {this.value=''}");
        txtYZM.Attributes.Add("OnBlur", "if(this.value==''){this.value='验证码'}");

        //账户名
        txtName.Attributes.Add("Value", "账户");
        txtName.Attributes.Add("OnFocus", "if(this.value=='账户') {this.value=''}");
        txtName.Attributes.Add("OnBlur", "if(this.value==''){this.value='账户'}");

        //密码
        txtPwd.Attributes.Add("Value", "密码(8至15位任意字符)");
        txtPwd.Attributes.Add("OnFocus", "if(this.value=='密码(8至15位任意字符)') {this.value=''}");
        txtPwd.Attributes.Add("OnBlur", "if(this.value==''){this.value='密码(8至15位任意字符)'}");

        //确认密码
        txtPwd0.Attributes.Add("Value", "再次输入密码");
        txtPwd0.Attributes.Add("OnFocus", "if(this.value=='再次输入密码') {this.value=''}");
        txtPwd0.Attributes.Add("OnBlur", "if(this.value==''){this.value='再次输入密码'}");
    }
}

}

就这样实现了一个简单的登陆
5.效果展示
asp.net58同城简单登陆