ASP.NET
  Home arrow ASP.NET arrow Page 4 - A Demo of the Wizard Control in ASP.NET 2....
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

A Demo of the Wizard Control in ASP.NET 2.0
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 19
    2006-08-15

    Table of Contents:
  • A Demo of the Wizard Control in ASP.NET 2.0
  • The Minimum Wizard
  • A Basic Demo
  • Writing Code for the Steps
  • A Display of the Wizard in Action
  • Source Code of the Page

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    A Demo of the Wizard Control in ASP.NET 2.0 - Writing Code for the Steps


    (Page 4 of 6 )

    When the page loads, Step 1 will be in view and you should make sure that Step 1 is showing in the design view before you browse the page. Here you will be entering the names and clicking the Next button. The names you enter remain in the textboxes. When you click the Next button, the wizard moves to Step 2.

    In Step 2 you will click the calendar control to add a date which will remain in the textbox in Step 2. When you click on the Next button you will move to Step 3.

    In Step 3 you gather up all the information, and when you click on the Finish button you will display it in Step 3's "View Area." The code for the logic followed by the steps is shown in the next paragraph.

    Partial Class wiz
    Inherits System.Web.UI.Page
    Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, _
    ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) _
    Handles Wizard1.FinishButtonClick
    Label1.Visible = True
    TextBox3.Visible = False
    Label2.Visible = False
    Label1.Text = "<font color='blue'>" + TextBox3.Text _
    + "</font>" + "<p></p>" + "<font color='green'>" + _
    TextBox1.Text + " " + TextBox2.Text + "</font>" + _
    "<br/>" + "Your last visit was on  " + TextBox4.Text
    End Sub
    Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, _
    ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) _
    Handles Wizard1.NextButtonClick '[logic] if this logic is omitted
    the Label1's text Label 
    would show up 'going from step 2 to three.
    If e.NextStepIndex = 2 Then Label1.Visible = False End If '[/logic] 'The textbox3 contents are carried forward
    to finish 'but it's visibility is set to false
    TextBox3.Visible =
    False 'must be false TextBox3.Text = "We Cordially Welcome You Back" End Sub Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged TextBox4.Text = Calendar1.SelectedDate.ToShortDateString End Sub End Class

    A couple of annotations are in the code. The Label1.text after the Finish button is clicked collects all information and presents it. Textbox4 carries the date information from Step 2, while Textbox1 and Textbox2 carry the name information from Step1. If Textbox3 is not set to false in the Finish event, then Textbox3 will show through. The steps are indexed with 0 as the start index. Also note that the UI is represented by a partial class.

    More ASP.NET Articles
    More By Jayaram Krishnaswamy


       · The wizard control makes it so easy to crate a wizard you would not believe....
     

    ASP.NET ARTICLES

    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...
    - Building an In-Text Advertising System Under...
    - Developing a Mini ASP.NET AJAX Server Centri...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT