How can MultiView Control be created in 2.0?

Platform: ASP.NET| Category: Custom Controls

A MultiView is a non-visual control that provides a pallette where a several view Controls can be placed. A view control is another non-visual control where you can place the user interface controls.It is simillar to that of a Tab control.The below code demonstrate how MultiView can be created,


<div>
	<asp:Button id='Button1' runat='server' Text='View 1' OnClick='Button1_Click' />
	<asp:Button id='Button2' runat='server' Text='View 2' OnClick='Button2_Click' /> 
	<asp:Button id='Button3' runat='server' Text='View 3' OnClick='Button3_Click' />
	<br />
	<br />
	<asp:MultiView id='MultiView1' runat='server' ActiveViewIndex=0>
		<asp:View id='View1' runat='server'>
			Content Here (View 1)...
		 	<asp:BulletedList  ID='BulletedList1' runat='server'>
				<asp:ListItem>My Schedule On 1st Week</asp:ListItem>
				<asp:ListItem>My Schedule On 2nd Week</asp:ListItem>
				<asp:ListItem>My Schedule On 3rd Week</asp:ListItem>
				<asp:ListItem>My Schedule On 4th Week</asp:ListItem>
			</asp:BulletedList>
		</asp:View>
		<asp:View id='View2' runat='server'>
			Content Here (View 2)...
			<asp:Calendar ID='Calendar1' runat='server' BackColor='#FFFFCC' 
				BorderColor='#FFCC66' BorderWidth='1px' DayNameFormat='Shortest' 
				Font-Names='Verdana' Font-Size='8pt' ForeColor='#663399' Height='200px'
				 ShowGridLines='True' Width='220px'>
				<SelectedDayStyle BackColor='#CCCCFF' Font-Bold='True' />
				<TodayDayStyle BackColor='#FFCC66' ForeColor='White' />
				<SelectorStyle BackColor='#FFCC66' />
				<OtherMonthDayStyle ForeColor='#CC9966' />
				<NextPrevStyle Font-Size='9pt' ForeColor='#FFFFCC' />
				<DayHeaderStyle BackColor='#FFCC66' Font-Bold='True' Height='1px' />
				<TitleStyle BackColor='#990000' Font-Bold='True' Font-Size='9pt' 
				ForeColor='#FFFFCC' />
			</asp:Calendar>
		</asp:View>
		<asp:View id='View3' runat='server'>
			Content Here (View  3)...
			<br />
			<asp:Label ID='Label1' runat='server' Text='Schedule Details'></asp:Label>
		</asp:View>
	</asp:MultiView>
</div>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.