DotNet Solution

  • Home
  • Asp.net
    • Controls
    • DataControl
    • Ajax
  • Web Design
    • Html
    • Css
    • Java Script
  • Sql
    • Queries
    • Function
    • Stored Procedures
  • MVC
    • OverView
    • Create First Application
  • BootStrap
    • Collapse Function

Saturday, 9 July 2016

Asp.net- MultiView

  Unknown       00:26       Controls       1 comment    

MultiView and View controls allow you to divide the content of a page into different groups, displaying only one group at a time. Each View control manages one group of content and all the View controls are held together in a MultiView control.
The MultiView control is responsible for displaying one View control at a time. The View displayed is called the active view.

The syntax of MultiView control is:
<asp:MultView ID= "MultiView1" runat= "server">
</asp:MultiView>
 
The syntax of View control is:
 <asp:View ID= "View1" runat= "server">
</asp:View> 

However, the View control cannot exist on its own. It would render error
 if you try to use it stand-alone. It is always used with a Multiview 
control as:
<asp:MultView ID= "MultiView1" runat= "server">
   <asp:View ID= "View1" runat= "server"> </asp:View>
</asp:MultiView> 
 
Properties
ActiveViewIndex- A zero based index that denotes the active view. If no view is active, then the index is -1.

Example-
 Aspx Source Code-
<table border="0" cellpadding="2" cellspacing="3" width="100%">
<tr>
<td>
<asp:LinkButton ID="lnkTab1" runat="server" OnClick="lnkTab1_Click">Tab1</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkTab2" runat="server" OnClick="lnkTab2_Click">Tab2</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkTab3" runat="server" OnClick="lnkTab3_Click">Tab3</asp:LinkButton></td>
</tr>
<tr>
<td colspan="3">
<asp:MultiView ID="MultiView1" runat="server">
<table width="100%" cellpadding="2" cellspacing="5">
<tr>
<td>
<asp:View ID="View1" runat="server">
Content 1 goes here</asp:View>
</td>
<td>
<asp:View ID="View2" runat="server">
Content 2 goes here</asp:View>
</td>
<td>
<asp:View ID="View3" runat="server">
content 3 goes here</asp:View>
</td>
</tr>
</table>
</asp:MultiView></td>
</tr>
</table

C# Code
protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
   {
   SetDefaultView();
   }
}
private void SetDefaultView()
{
MultiView1.ActiveViewIndex = 0;
}
protected void lnkTab1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void lnkTab2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
protected void lnkTab3_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 2;
}

OutPut-







  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Email This BlogThis! Share to X Share to Facebook
Newer Post Older Post Home

1 comment :

  1. Mechanical engineering ?8 November 2016 at 11:08

    Thanks this is work perfectly this code

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

Popular Posts

  • Auto Increment Id in Sql Server
    SQL server identity column values use in table Steps- Firstly Open-> Sql Server Create Table -> First Field Like ID Usually Autoi...
  • Numeric Value Validation Through JavaScript
    Validate Only Numeric Value Enter In TextBox Using JavaScript function Firstly Write Java Script Function in <head tag> in Asp.Net ...
  • Asp.net- MultiView
    MultiView and View controls allow you to divide the content of a page into different groups, displaying only one group at a time. Each Vie...
  • Reset Identity Column in Sql Server
    We Want To Reset Identity Column Then Use Code.If We Delete column By Id Like We delete 5 no id and After Than we Insert New then We get 6...
  • Email Validation In JavaScript
    We use Validation for Email  in Javascript like in above example <!DOCTYPE html> <html> <head> <script> fu...
  • Javascript Regular Expression Email Validate
    Validate Email using Regular Expression In JavaScript- 1. Create Input type Text box and and onclick cal  checkemail function of Javascr...
  • MVC Framework Architecture
    MVC Flow- MVC application takes place when certain request comes from the client. The diagram below shows the flow: Flow Steps ...
  • Create First MVC Application
    How to create MVC First simple application It is very easy to make application in mvc follow some steps and create first application ST...
  • Count Number Of Word In Sql Server
    We Count HowMany Words Present in This String Through Function in Sql Server Then Use This Code CREATE FUNCTION fnCountOccurences     ...
  • Collapse Function Use in Bootstrap.
    Defination  1.  Collapse Means suddenly fall down. 2.  Just add data-toggle="collapse" and a data-target to element to ...

Blog Archive

  • ▼  2016 ( 36 )
    • ►  February ( 1 )
    • ►  March ( 5 )
    • ►  April ( 1 )
    • ►  June ( 10 )
    • ▼  July ( 6 )
      • Asp.net- MultiView
      • Reset Identity Column in Sql Server
      • Count Number Of Word In Sql Server
      • Values Enter With SplitFunction in Sql Server
      • Split Function in Sql Serever
      • Numeric Value Validation Through JavaScript
    • ►  November ( 8 )
    • ►  December ( 5 )
  • ►  2017 ( 1 )
    • ►  January ( 1 )
Powered by Blogger.

Categories

  • Ajax
  • AllFunction
  • Controls
  • CreateApplication
  • css
  • Function
  • javascript
  • Js
  • over view
  • OverView
  • Queries
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © DotNet Solution | Powered by Blogger
Design by Vibha Acharya