当前位置:网站首页>ASP using panel to realize simple registration page
ASP using panel to realize simple registration page
2022-06-29 21:58:00 【Eighty eight old】
newly build web forms Panel.aspx
Drag in control Panel It's a container , Controls can be placed in containers 
here aspx Code :( The design is as follows )
```bash
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Panel.aspx.cs" Inherits="Chap2_Panel" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="pnlStep1" runat="server">
First step : enter one user name
<br />
user name :<asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnStep1" runat="server" Text=" next step " />
</asp:Panel>
</div>
</form>
</body>
</html>
The same can be , Add a second 、 Three panels
```bash
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Panel.aspx.cs" Inherits="Chap2_Panel" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="pnlStep1" runat="server">
First step : enter one user name
<br />
user name :<asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnStep1" runat="server" Text=" next step " />
</asp:Panel>
<asp:Panel ID="pnlStep2" runat="server">
The second step : Enter user information <br /> full name :<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<br />
Telephone :<asp:TextBox ID="txtTelephone" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnStep2" runat="server" Text=" next step " />
</asp:Panel>
<asp:Panel ID="pnlStep3" runat="server">
The third step : Please confirm your input information <br />
<asp:Label ID="lb1Msg" runat="server" Text="Label"></asp:Label>
<br />
<asp:Button ID="btnStep3" runat="server" Text=" confirm " />
</asp:Panel>
</div>
</form>
</body>
</html>
Go to background code aspx.cs
Set the page to load for the first time pnlStep1 so
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
pnlStep1.Visible = true;
pnlStep2.Visible = false;// invisible
pnlStep3.Visible = false;
}
}
Double click the first button , Set up events
protected void btnStep1_Click(object sender, EventArgs e)
{
pnlStep1.Visible = false;
pnlStep2.Visible = true;
pnlStep3.Visible = false;
}
Double click the second button , Set up events
protected void btnStep2_Click(object sender, EventArgs e)
{
pnlStep1.Visible = false;
pnlStep2.Visible = false;
pnlStep3.Visible = true;
lb1Msg.Text = " user name :" + txtUser.Text + "<br/> full name :" + txtName.Text + "<br/> Telephone :" + txtTelephone.Text;// Output user information
}
Double click the third button , Set up events
protected void btnStep3_Click(object sender, EventArgs e)
{
// Save user information to the database
}
aspx Complete code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Panel.aspx.cs" Inherits="Chap2_Panel" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="pnlStep1" runat="server">
First step : enter one user name
<br />
user name :<asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnStep1" runat="server" Text=" next step " OnClick="btnStep1_Click" />
</asp:Panel>
<asp:Panel ID="pnlStep2" runat="server">
The second step : Enter user information <br /> full name :<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<br />
Telephone :<asp:TextBox ID="txtTelephone" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnStep2" runat="server" Text=" next step " OnClick="btnStep2_Click" />
</asp:Panel>
<asp:Panel ID="pnlStep3" runat="server">
The third step : Please confirm your input information <br />
<asp:Label ID="lb1Msg" runat="server" Text="Label"></asp:Label>
<br />
<asp:Button ID="btnStep3" runat="server" Text=" confirm " OnClick="btnStep3_Click" />
</asp:Panel>
</div>
</form>
</body>
</html>
aspx.cs Complete code
using System;
public partial class Chap2_Panel : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
pnlStep1.Visible = true;
pnlStep2.Visible = false;
pnlStep3.Visible = false;
}
}
protected void btnStep1_Click(object sender, EventArgs e)
{
pnlStep1.Visible = false;
pnlStep2.Visible = true;
pnlStep3.Visible = false;
}
protected void btnStep2_Click(object sender, EventArgs e)
{
pnlStep1.Visible = false;
pnlStep2.Visible = false;
pnlStep3.Visible = true;
lb1Msg.Text = " user name :" + txtUser.Text + "<br/> full name :" + txtName.Text + "<br/> Telephone :" + txtTelephone.Text;// Output user information
}
protected void btnStep3_Click(object sender, EventArgs e)
{
// Save user information to the database
}
}

边栏推荐
- Layer 3 loop brought by route Summary - solution experiment
- Flutter technology and Practice (2)
- Golang operation etcd
- Yolov6 training your own data record +yolov5 comparison test
- 2022 openvino DevCon unveils secrets! Intel and many partners deepen the construction of developer ecology and release the innovation potential of AI industry
- Structure the fifth operation of the actual camp module
- Topic39——78. subset
- leetcode:370. Interval addition
- How to make good use of data science?
- R language plot visualization: plot visualization box graph and several box plots of multiple classification variables
猜你喜欢

Report delivery engineer

CORDIC based Signal Processor desgn
![[advanced ROS chapter] Lecture 4: duplicate names in ROS (nodes, topics and parameters)](/img/25/85e8c55605f5cc999a8e85f0a05f93.jpg)
[advanced ROS chapter] Lecture 4: duplicate names in ROS (nodes, topics and parameters)

Live broadcast preview | PostgreSQL kernel Interpretation Series Lecture 1: overview of PostgreSQL system

小型圖書館項目總結

Visual analysis and display effect of summer data

PostgreSQL weekly news - June 22

Motianlun "high availability architecture" dry goods document sharing (including 124 Oracle, MySQL and PG materials)

JD alliance API - universal chain transfer interface - Jingpin library interface - Interface Customization

【ROS进阶篇】第三讲 ROS文件系统与分布式通信
随机推荐
Water polo chart - using dynamic ripples to show percentages
Layer 3 loop brought by route Summary - solution experiment
R language plot visualization: plot to visualize the normalized histograms of multiple data sets, set different histograms to use different bin sizes, and add edge axis whisker graph rugs at the botto
Automatic reply of wechat bulletin number intelligent reply with Turing robot
Shutter bottomnavigationbar with page switching example
A new Polaris has risen!
Reflections on remote sensing image interpretation
Shangsilicon Valley real-time data warehouse project (Alibaba cloud real-time data warehouse)
Motianlun "high availability architecture" dry goods document sharing (including 124 Oracle, MySQL and PG materials)
Aleph farms hired a supervisor of regulatory affairs to prepare for global commercialization in advance
JD alliance API - universal chain transfer interface - Jingpin library interface - Interface Customization
How to integrate MES system with ERP? This article tells you the answer
2022 openvino DevCon unveils secrets! Intel and many partners deepen the construction of developer ecology and release the innovation potential of AI industry
CLI tool foundation of ros2 robot f1tenth
Wechat bulletin number Turing robot realizes intelligent reply
How to prepare samples for application of color coated steel sealing plates to BS 476-3?
How to use the DVD entry level in taro3.*
Shutter bottomnavigationbar toggle page hold
A keepalived high availability accident made me learn it again!
MES系统究竟有何独特之处?