.NET
  Home arrow .NET arrow Page 4 - Basic Usage of MultiView and View Controls...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Basic Usage of MultiView and View Controls in ASP.NET
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2006-11-08

    Table of Contents:
  • Basic Usage of MultiView and View Controls in ASP.NET
  • Creating a web page with MultiView and View controls
  • Design time properties of View Control
  • Container Properties of View and MultiView Controls
  • Presenting a user preferred View

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Basic Usage of MultiView and View Controls in ASP.NET - Container Properties of View and MultiView Controls


    (Page 4 of 5 )

    Just as you can access the properties of controls in forms in Visual Basic, or controls in the <form/> of a web page, you can access the controls placed in the View control and the Views placed in the MultiView control programmatically. This is done as shown in the next snippet for the design view shown here.

    Protected Sub MultiView1_Load(ByVal sender As Object, ByVal e _
    As System.EventArgs) Handles MultiView1.Load
    'This displays the view
    MultiView1.SetActiveView(View1)
    Response.Write("Number of View Controls in this MultiView : " & _
    MultiView1.Controls.Count & "<br>")
    Response.Write("Number of controls in the View control" & _
    "whose index is 0 : " & _
    MultiView1.Controls(0).Controls.Count & "<br>")
    Response.Write("Type of Control in View1 with index 0 : " & _
    MultiView1.Controls(0).Controls(0).GetType.ToString & "<br>")
    Response.Write("Type of Control in View1 with index 1 : " & _
    MultiView1.Controls(0).Controls(1).GetType.ToString & "<br>")
    Response.Write("Type of Control in View1 with index 2 : " & _
    MultiView1.Controls(0).Controls(2).GetType.ToString & "<br>")
    Response.Write("Type of Control in View1 with index 3 : " & _
    MultiView1.Controls(0).Controls(3).GetType.ToString & "<br>")
    Response.Write("Type of Control in View1 with index 4 : " & _
    MultiView1.Controls(0).Controls(4).GetType.ToString & "<br>")
    Response.Write("Type of Control in View1 with index 5 : " & _
    MultiView1.Controls(0).Controls(5).GetType.ToString & "<br>")
    End Sub 

    The displayed output of this web page is shown in the next picture. Although there are three controls in View1, there are six controls in the display, with three extra Literal controls. The page has two View controls. The controls and the Views can access their containers using the parent property.

    Once you access the control you may control its properties using the code support given by intellisense as shown.

    More .NET Articles
    More By Jayaram Krishnaswamy


       · Persisting user preferences is not a trivial task but users are more and more used...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT