[출처] MultiView 서버 컨트롤 - 도구 상자 - 표준 사용 법|작성자 여유
http://http://blog.naver.com/lsv400?Redirect=Log&logNo=100061738348ultiview 컨트롤을 올리고
view 컨트롤을 올리고 그안에 다른 컨트롤을 추가하여 사용
초기에 view 컨트롤을 보이게 하려면 multiview 컨트롤의 속성 - ActiveViewIndex 값 -1을 0으로 수정
view control 을 보이게 하려면 MultiView1.ActiveViewIndex 값을 주면 됨
=
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class MultiViewTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
// view 1
MultiView1.ActiveViewIndex = 0;
}
protected void Button2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
}
=
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MultiViewTest.aspx.cs" Inherits="MultiViewTest" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="view1" />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="view2" />
<br />
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button3" runat="server" Text="Button" />
</asp:View>
<asp:View ID="View2" runat="server">
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>