在asp.net中有两种容器控件,其中包括panel和placeholder控件。 
使用panel控件可以对控件进行分组。一帮助组织web窗体也的内容,将控件组织在面板中,可提供有关在运行时控件应如何分页显示的信息。这里也就是我们所说的在一个页面中通过 “提交”或“下一步”按钮来显示不同的虚假页面,即通过隐藏可以实现,还有panel的外观属性,来设置panel的外观特性。 
简单的用户注册流程图: 
html代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits=" 容器控件._Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
        <title>用户注册流程图</title> 
        <style type="text/css"> 
                .style1 
                { 
                        text-align: center; 
                } 
        </style> 
</head> 
<body> 
        <form id="form1" runat="server"> 
        <div> 
 
                <asp:Panel ID="Panel1" runat="server" BorderStyle="Groove" Height="333px" 
                        style="text-align: center" Width="909px"><h1> 用户注册</h1> 
                     <table style="height: 218px"> 
<tr id="Tr1" runat="server"> 
<td>用户名:</td> 
<td><asp:TextBox runat="server" ID="username"></asp:TextBox></td> 
<td> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="username" Display="Dynamic" ErrorMessage="请正确输入用户名"></asp:RequiredFieldValidator><! 对用户输入的信息进行非空验证,并为动态显示,如验证不通过弹出”请输入用户名“> 
                </td> 
</tr> 
<tr> 
<td>密码:</td> 
<td><asp:TextBox runat="server" ID="password1" TextMode="Password"></asp:TextBox> </td> 
<td> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="password1" Display="Dynamic" ErrorMessage="请输入密码!"></asp:RequiredFieldValidator><! 对密码进行非空验证,并为动态显示,错误时提示:请输入密码> 
                                                </td> 
</tr> 
<tr> 
<td>密码确认:</td> 
<td><asp:TextBox runat="server" ID="password2" TextMode="Password"></asp:TextBox></td> 
<td> 
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                ControlToCompare="password1" ControlToValidate="password2" Display="Dynamic" 
                                ErrorMessage="请确认密码正确性"></asp:CompareValidator><!这里的controltocompare是对第一次输入的密码进行比较,测试十分保持一致> 
                                                </td> 
</tr> 
<tr> 
<td>性别:</td> 
<td> 
<asp:RadioButton Text="男" ID="rd1" runat="server" GroupName="1" /><!groupname必须相同> 
<asp:RadioButton Text="女" ID="rd2" runat="server" GroupName="1" /> 
</td> 
<td></td> 
</tr> 
<tr> 
<td>联系电话:</td> 
<td><asp:TextBox runat="server" ID="telephone"></asp:TextBox>< /td><!正则表达式偶还没学> 
<td> 
        <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="请输入电话号码" 
                MaximumValue="199999999999" MinimumValue="0" 
                ControlToValidate="telephone"></asp:RangeValidator><! 比较粗糙的定义范围,最小值为0.,最大值为19999999999> 
        </td> 
</tr> 
<tr> 
<td>兴趣爱好:</td> 
<td> 
<asp:CheckBox runat="server" ID="cb1" Text="篮球" /> 
<asp:CheckBox runat="server" ID="cb2" Text="足球" /> 
<asp:CheckBox runat="server" ID="cb3" Text="排球" /> 
<asp:CheckBox runat="server" ID="cb4" Text="读书" /> 
</td> 
<td></td> 
</tr> 
<tr> 
<td colspan="2" style="text-align: center"> 
                 </td> 
<td></td> 
</tr> 
</table> 
                        <asp:Button ID="Button1" runat="server" Text="下一步" onclick="Button1_Click" /> 
                        <br /> 
                        <br /> 
                </asp:Panel> 
 
        </div><br/> 
        <asp:Panel ID="Panel2" runat="server" BorderStyle="Groove" Height="270px" 
                Visible="False"><h3 style="text-align: center">确认信息</h3> 
                <p style="text-align: center"> 
                        用户名:<asp:Label ID="xusername" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p style="text-align: center"> 
                        密码:<asp:Label ID="xpassword" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p style="text-align: center"> 
                        联系电话:<asp:Label ID="xtelephone" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p style="text-align: center"> 
                        兴趣爱好:<asp:Label ID="xaihao" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p style="text-align: center"> 
                        <asp:Button ID="Button2" runat="server" Text="下一步" onclick="Button2_Click" /> 
                </p> 
        </asp:Panel> 
        <asp:Panel ID="Panel3" runat="server" Height="411px" Width="920px"> 
                <h1 class="style1">恭喜您注册成功</h1> 
                <p class="style1"> 
                        请切记您账号和密码:</p> 
                        <p style="text-align: center"> 
                        用户名:<asp:Label ID="Label1" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p style="text-align: center"> 
                        密码:<asp:Label ID="Label2" runat="server" Text="Label" Width="161px"></asp:Label> 
                </p> 
                <p class="style1"> 
                         </p> 
        </asp:Panel> 
        </form> 
</body> 
</html>

后台c#代码:

using System; 
using System.Collections; 
using System.Configuration; 
using System.Data; 
using System.Linq; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.HtmlControls; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Xml.Linq; 
 
namespace 容器控件 

 public partial class _Default : System.Web.UI.Page 
        { 
 protected void Page_Load(object sender, EventArgs e) 
                { 
 
this.Panel3.Visible = false;//放在这里实在页面加载时就把panel3隐藏 
                } 
 
protected void Button1_Click(object sender, EventArgs e) 
                { 
 this.Panel1.Visible = false;//点击按钮“下一步”是 panel1隐藏 
 this.Panel2.Visible = true;//同时panel2显示出来 
 this.xusername.Text = this.username.Text;// 把用户的信息放到自定义的label中,感觉很麻烦,希望会有更好的办法 
 this.xpassword.Text = this.password1.Text; 
 this.xtelephone.Text = this.telephone.Text; 
 
                } 
 
protected void Button2_Click(object sender, EventArgs e) 
                { 
 this.Panel2.Visible = false;//点击按钮“下一步”是 panel2隐藏 
 this.Panel3.Visible = true;//同时panel3显示出来 
 
                } 
        } 
}

整个流程图比较简单,运用的主要是textbox控件,label控件,验证控件,Button控件,panel容器控件,其中验证空间运用的比较粗糙,继续改进。

作者:神舟龙

    

(转)asp.net注册实现下一步的更多相关文章

  1. ASp.net 注册

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs ...

  2. 使用ASP.NET注册工具aspnet_regiis.exe注册IIS

    该工具的名称为aspnet_regiis.exe,在32位机上,该工具存在于C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727,在64位机中“Framework ...

  3. winserver 08 64位安装sql05 64位提示asp版本注册

    将打开 安装IIS 6.0的就可以了,然后重启下

  4. Asp.Net 注册 邮箱激活

    数据库 表的设计 State为用户状态  0为禁用  1为可用  默认为0,下面有个UserGUID,这个字段将来用于激活账户 首先你要写一个表单,验证码神马的,这个我就不写了..直接写处理的 代码在 ...

  5. ASP.NET中使用Entity Framework开发登陆注册Demo

    这里更多的是当作随身笔记使用,记录一下学到的知识,以便淡忘的时候能快速回顾 当前步骤是该项目的第一部分 第一部分(当前) 第二部分 大完结版本 直接上步骤,有类似的开发登陆注册也可以参考. 登陆注册的 ...

  6. 部署 外网 ASP.NET程序时, IIS安全性 配置 -摘自网络

    最近,和朋友们在聊及ASP.NET程序的安全性没有JAVA高,IIS(Internet Infomartion Server)的存在很多漏洞(以及新型蠕虫,例如Code Red 和Nimda),安全得 ...

  7. ASP.NET MVC 从零开始 - 请求处理

    这篇文章是从我的 github 博客 lxconan.github.io 导入的. 这是这个系列的第三篇了.前两篇文章请参见: ASP.NET MVC 从零开始 - Create and Run AS ...

  8. IIS7如何部署asp.net网站

      第一步:发布网站 右键asp.net web项目,选择发布, 然后新建配置文件名称并选择 "文件系统" 发布方法. 目标位置选择本地新建的文件夹如: IISWebSite 第二 ...

  9. ASP DropDownList部分选项无法触发回传问题

    今天偶然碰到这个问题,一个通过后台绑定的DropDownList控件出现部分选项触发事件,部分选项不触发事件的问题: 原因是多个OPTION的Value值一致,导致ASP事件注册失败,只要在绑定过程中 ...

随机推荐

  1. 单点登录CAS使用记(八):使用maven的overlay实现无侵入的改造CAS

    前期在学习CAS部署的过程中,都是网上各种教程,各种方案不停的尝试. 期间各种侵入改源码,时间久了,改了哪个文件,改了哪段配置,增加了哪段代码,都有可能混淆不清了. 而且最大的问题是,万一换个人来维护 ...

  2. 武汉科技大学ACM :1007: A+B for Input-Output Practice (VII)

    Problem Description Your task is to Calculate a + b. Input The input will consist of a series of pai ...

  3. 转载:详解CSS选择器、优先级与匹配原

    转载网址:http://polaris1119.javaeye.com/blog/764428 文章就CSS选择器的优先级问题做了一些总结,严格来讲,选择器的种类可以分为三种:标签名选择器.类选择器和 ...

  4. 淘宝接口实现ip归属地查询

    <?php header('content-type:text/html;charset=utf-8'); /*获取当前ip归属地 调用淘宝接口 */ function get_ip_place ...

  5. mysql_config not found

    在python中安装MySQL_python.不想通过下载源码编译,而是想用 easy_install MySQL_python 来安装.结果一直报错: mysql_config not found ...

  6. for-in语句

    <script type="text/javascript"> /* for-in语句: for-in语句的格式: for(var 变量名 in 遍历的目标){ } f ...

  7. MySQL原生HA方案 – Fabric体验之旅

    http://www.csdn.net/article/2014-08-20/2821300

  8. uva 10007 Count the Trees

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  9. poj 3130 How I Mathematician Wonder What You Are!

    http://poj.org/problem?id=3130 #include <cstdio> #include <cstring> #include <algorit ...

  10. linux 信号signal和sigaction理解

    今天看到unp时发现之前对signal到理解实在浅显,今天拿来单独学习讨论下. signal,此函数相对简单一些,给定一个信号,给出信号处理函数则可,当然,函数简单,其功能也相对简单许多,简单给出个函 ...