using System;
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;

public partial class _Default : System.Web.UI.Page 
{

    protected void NextButton_Command(object sender, EventArgs e)
    {
        // Determine which button was clicked
        // and set the ActiveViewIndex property to
        // the view selected by the user.
        if (MultiView1.ActiveViewIndex > -1 & MultiView1.ActiveViewIndex < 3)
        {
            // Increment the ActiveViewIndex property 
            // by one to advance to the next view.
            MultiView1.ActiveViewIndex += 1;
        }
        else if (MultiView1.ActiveViewIndex == 3)
        {
            // This is the final view.
            // The user wants to save the survey results.
            // Insert code here to save survey results.
            // Disable the navigation buttons.
            Page4Save.Enabled = false;
            Page4Restart.Enabled = false;
        }
        else
        {
            throw new Exception("An error occurred.");
        }
    }

    protected void BackButton_Command(object sender, EventArgs e)
    {
        if (MultiView1.ActiveViewIndex > 0 & MultiView1.ActiveViewIndex <= 2)
        {
            // Decrement the ActiveViewIndex property
            // by one to return to the previous view.
            MultiView1.ActiveViewIndex -= 1;
        }
        else if (MultiView1.ActiveViewIndex == 3)
        {
            // This is the final view.
            // The user wants to restart the survey.
            // Return to the first view.
            MultiView1.ActiveViewIndex = 0;
        }
        else
        {
            throw new Exception("An error occurred.");
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
    {

    }
    protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
    {

    }
    protected void Page1Next_Click(object sender, EventArgs e)
    {
        NextButton_Command(sender, e);
    }
    protected void Page2Next_Click(object sender, EventArgs e)
    {
        NextButton_Command(sender, e);

    }
    protected void Page3Next_Click(object sender, EventArgs e)
    {
        NextButton_Command(sender, e);

    }
    protected void Page4Save_Click(object sender, EventArgs e)
    {
        NextButton_Command(sender, e);

    }
    protected void Page2Back_Click(object sender, EventArgs e)
    {
        BackButton_Command(sender, e);
    }
    protected void Page3Back_Click(object sender, EventArgs e)
    {
        BackButton_Command(sender, e);

    }
    protected void Page4Restart_Click(object sender, EventArgs e)
    {
        BackButton_Command(sender, e);

    }
}
