Multiview in ASP .Net

Multiview in ASP .net with example of Survey web form:

I have used <! –    –> to make the text as comment this is the way to make comment in this code …
source code:


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>


<script runat="server">
    protected void Page4SaveButton_Click(object s, EventArgs e)
    {
        Page4Save.Enabled = false;
        Page4Restart.Enabled = false;
    }
</script>
<!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>Type your web page title here</title><!– Here you can specify your page title in between title tag->
<!– In between div tag u place your controls but it is not neccasarry tht u hav to specify not at all ->

</head>
<body>
    <form id="form1" runat="server">
   <h2>Multiview Example::Survey Form</h2>
<!–specifing panel name i taken a panel to arrange controls like multiview and views->
   <asp:Panel id="Page1ViewPanel" 
        Width="330px" 
        Height="150px"
        HorizontalAlign="Center"
        Font-size="12" 
        BackColor="AliceBlue"
        BorderColor="#404040"
        BorderStyle="Double"                     
        runat="Server">  

        <asp:MultiView id="DevPollMultiView"
          ActiveViewIndex="0"
          runat="Server">

          <asp:View id="Page1" 
            runat="Server">   

            <asp:Label id="Page1Label" 
              Font-bold="true"                         
              Text="What kind of applications do you develop?"
              runat="Server"
              AssociatedControlID="Page1">
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page1Radio1"
              Text="Web Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page1Radio2"
              Text="Windows Forms Applications" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="server">
            </asp:RadioButton>
                     <!– close br tag used to specify that line has been break here->
            <br/><br/><br/>         
                              
                     <!–CommandName property of button i write NextView its some predefined values or commands to carry out from one view to next view and when user click on next button then it will get show next view to user without losting the data of last view->
            <asp:Button id="Page1Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button>     
                          
          </asp:View>

          <asp:View id="Page2" 
            runat="Server">

            <asp:Label id="Page2Label" 
              Font-bold="true"                        
              Text="How long have you been a developer?"
              runat="Server"
              AssociatedControlID="Page2">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page2Radio1"
              Text="Less than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page2Radio2"
              Text="More than five years" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/><br/>

<!– in other button i used PrevView in CommandName it allow user to get back to previous view and its predefined command in asp .net->
            <asp:Button id="Page2Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat= "Server">
            </asp:Button> 

            <asp:Button id="Page2Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 
                
          </asp:View>

          <asp:View id="Page3" 
            runat="Server">

            <asp:Label id="Page3Label1" 
              Font-bold="true"                        
              Text= "What is your primary programming language?"                        
              runat="Server"
              AssociatedControlID="Page3">                    
            </asp:Label>
            
            <br/><br/>

            <asp:RadioButton id="Page3Radio1"
              Text="Visual Basic" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio2"
              Text="C#" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/>

            <asp:RadioButton id="Page3Radio3"
              Text="C++" 
              Checked="False" 
              GroupName="RadioGroup1" 
              runat="Server">
            </asp:RadioButton>
            
            <br/><br/>

            <asp:Button id="Page3Back"
              Text = "Previous"
              CommandName="PrevView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button> 

            <asp:Button id="Page3Next"
              Text = "Next"
              CommandName="NextView"
              Height="25"
              Width="70"
              runat="Server">
            </asp:Button>
            
            <br/>
                    
          </asp:View>     
            
          <asp:View id="Page4"
            runat="Server">
                    
          <asp:Label id="Label1"
            Font-bold="true"                                           
            Text = "Thank you for taking the survey."
            runat="Server"
            AssociatedControlID="Page4">
          </asp:Label>
                    
          <br/><br/><br/><br/><br/><br/>       
                           
          <asp:Button id="Page4Save"
            Text = "Save Responses"
            OnClick="Page4SaveButton_Click" <!–i created an event to which will fire on click of save button->
            Height="25"
            Width="110"
            runat="Server">
          </asp:Button>
                <!–in this button below button i specify SwitchViewByID in commandname it specify to get restart of survey or it restart from first view and its also predefined in .net
          <asp:Button id="Page4Restart"
            Text = "Retake Survey"
            commandname="SwitchViewByID"
            commandargument="Page1"
            Height="25"
            Width="110"
            runat= "Server">
          </asp:Button>                    
                    
        </asp:View>  
       
      </asp:MultiView>
        
    </asp:Panel> 

  </form><!–closing of forms and like tht i closed other tags
</body>
</html>