Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > VB.NET > 试用ASP.NET 2.0 Beta2 Wizard 控件
【标  题】:试用ASP.NET 2.0 Beta2 Wizard 控件
【关键字】:ASP.NET,2.0,Beta2,Wizard
【来  源】:http://Hover.cnblogs.com/archive/2005/06/07/169288.html

试用ASP.NET 2.0 Beta2 Wizard 控件

Your Ad Here

在2.0中多了很多控件!其中包括了wizard控件!
Wizard控件可以在视图之间自动切换。在VS.NET的环境下设计支持也很好! 
 所有的原素都可以看做是默认的,并且可以通过样式来调整,或用模板单独进行格式化
在工具栏中拖Wizard控件到设计窗口当中。

默认只有两步!
选中Step1 右边会出现对应的输入框。放置当在Step1时所显示的信息
这里我们放置TextBox控件ID为tbName
然后再选中Step2。在其相应的输入框中放置一个Label控件ID为LbName 

选中Wizard控件,切换到事件窗口.
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
 {
  this.Lbname.Text = this.tbName.Text;
 }
在切换窗口事件中把Step1的TextBox控件的值赋给Step2的Label控件!
运行 在step1中输入ITHero.NET

可以在设计视图时选中某个Step。然后运行时就是哪个Step默认选中!
附代码
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Wizard.aspx.cs" Inherits="Wizard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Wizard ID="Wizard1" runat="server" OnActiveStepChanged="Wizard1_ActiveStepChanged" ActiveStepIndex="0" Height="87px" Width="249px">
            <WizardSteps>
                <asp:WizardStep runat="server" Title="Step 1">
                    hello&nbsp;<br />
                    Please enter &nbsp;your name<br />
                    <asp:TextBox ID="tbName" runat="server"></asp:TextBox>
                </asp:WizardStep>
                <asp:WizardStep runat="server" Title="Step 2">
                    you name
                    <asp:Label ID="Lbname" runat="server" Text="Label"></asp:Label>
                </asp:WizardStep>
            </WizardSteps>
        </asp:Wizard>
        &nbsp;&nbsp;
   
    </div>
    </form>
</body>
</html>
--------------------------------------------

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 
public partial class Wizard : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
       protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
       {
              this.Lbname.Text = this.tbName.Text;
       }
}
FREE ASP.NET 2.0 Beta Hosting Test Account:【上一篇】
简单地址重写:【下一篇】
【相关文章】
  • FREE ASP.NET 2.0 Beta Hosting Test Account
  • Click button only once in asp.net 2.0
  • 大家赶快去注册ASP.NET 2.0的免费空间啊
  • AspnetUpload 2.3 for ASP.NET 2.0
  • Array & IList (something wrong in Windbey beta2)
  • Transaction in ADO.net 2.0
  • 关于学习.Net2.0的建议
  • .Net 2.0中的DriveInfo类
  • ADO.NET 2.0中的DataSet和DataTable
  • 试用wincvs2.0
  • 【随机文章】
  • Linux下PhpMyAdmin程序目录的安全管理
  • 大数运算(二)
  • MartinFowler: IOC, not IOC Container
  • Fedora Core 6 下 vmware-config.pl 错误(config.h)解决方法
  • 用ILLUSTRATOR绘制飘动的国旗
  • 路径及深度交换
  • Separate Contract from Implementation
  • DataGrid学习三
  • 巧用FC5的“添加/删除程序”
  • 学习JAVA的经验
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.