<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
MultiView & View Controls
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
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 _Default : System.Web.UI.Page
{
protected void Page_PreRender(object sender, EventArgs e)
{
lblCurrentIndex.Text = MultiView1.ActiveViewIndex.ToString();
}
protected void rblView_SelectedIndexChanged(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = Convert.ToInt32(rblView.SelectedValue);
}
protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
{
lblFirstTextBox.Text = txtFirstView.Text;
lblSecondTextBox.Text = txtSecondView.Text;
rblView.SelectedIndex = MultiView1.ActiveViewIndex + 1;
}
protected void ActivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " activated
";
lblViewActivation.Text = str;
}
protected void DeactivateView(object sender, EventArgs e)
{
string str = lblViewActivation.Text;
View v = (View)sender;
str += "View " + v.ID + " deactivated
";
lblViewActivation.Text = str;
}
}