zoukankan      html  css  js  c++  java
  • 20151223:Web:审核:注册

    aspx代码:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ZhuCe.aspx.cs" Inherits="ZhuCe" %>
    
    <!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>
        <style>
        .dl {
            margin:0px auto;
            padding:0px;
            left:400px;
            width:304px ;
            height:358px;
        }
    </style>
    
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="dl">
            <h1>&nbsp;&nbsp;&nbsp; 注册</h1>
            <p>
                &nbsp;
                <asp:Label ID="Label1" runat="server" Text="用户名:"></asp:Label>
                <asp:TextBox ID="TextBox1" runat="server" Height="19px"></asp:TextBox>
            </p>
            <p>&nbsp;&nbsp;
                <asp:Label ID="Label2" runat="server" Text="密码:"></asp:Label>
                <asp:TextBox ID="TextBox2" runat="server" Height="19px"></asp:TextBox>
            </p>
            <p>&nbsp;&nbsp;
                <asp:Label ID="Label3" runat="server" Text="姓名:"></asp:Label>
                <asp:TextBox ID="TextBox3" runat="server" Height="19px"></asp:TextBox>
            </p>
            <p>&nbsp;&nbsp;
                <asp:Label ID="Label4" runat="server" Text="性别:"></asp:Label>
                <asp:RadioButton ID="RadioButton1" runat="server" Checked="True" GroupName="Sex" Text="男" />
    &nbsp;&nbsp;
                <asp:RadioButton ID="RadioButton2" runat="server" GroupName="Sex" Text="女" />
            </p>
            <p>&nbsp;&nbsp;
                <asp:Label ID="Label5" runat="server" Text="生日:"></asp:Label>
                <asp:TextBox ID="TextBox4" runat="server" Height="19px"></asp:TextBox>
            </p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="Button1" runat="server" Text="注册" OnClick="Button1_Click" />
            </p>
        </div>
        </form>
    </body>
    </html>

    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 ZhuCe : System.Web.UI.Page
    {
        private UsersDataContext context = new UsersDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //取值
            string uid = TextBox1.Text;
            string pwd = TextBox2.Text;
            string name = TextBox3.Text;
            bool sex = RadioButton1.Checked;
            DateTime birthday = Convert.ToDateTime(TextBox4.Text);
            //造对象
            users data = new users();
            data.UserName = uid;
            data.PassWord = pwd;
            data.Name = name;
            data.Sex = sex;
            data.Birthday = birthday;
            data.State = 0;
            //添加
            context.users.InsertOnSubmit(data);
            context.SubmitChanges();
        }
    }

  • 相关阅读:
    Redis系列(七):数据结构List双向链表中LPUSH、LPOP、RPUSH、RPOP、LLEN命令
    Redis系列(六):数据结构QuickList(快速列表)源码解析
    C#数据结构与算法系列(二十):插入排序算法(InsertSort)
    3.WebPack配置文件
    2.WebPack初始化
    1.WebPack概念
    kubernetes控制器之StatefulSet
    kubernetes控制器之Deployment
    kubernetes控制器之ReplicaSet
    kubernetes创建pod的底层是怎么实现的?
  • 原文地址:https://www.cnblogs.com/mn-b/p/5079173.html
Copyright © 2011-2022 走看看