.NET
  Home arrow .NET arrow Page 3 - 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 - Design time properties of View Control


    (Page 3 of 5 )

    While the ID and runat attributes are added by default, you could access other properties and invoke events of the View control as shown in the next picture.

    The run time properties and methods of View1 can be accessed from the code page as shown. It may be noticed that there is no style property for a view. The controls' style, or style applied from skins, may be used.

    In the following design view of the web page, you may use one of several ways to make View1 display when the page is browsed.

    You may use the Form_Load() event to make View1 display using either of the following statements. The one that is commented out displays the required View as an argument, whereas the other uses the ActiveViewIndex property, which refers to the 0 based index property of collection of the Views in the MultiView container.

     Protected Sub form1_Load(ByVal sender As Object, ByVal e As _ 
    System.EventArgs) Handles form1.Load 'MultiView1.SetActiveView(View1)
    MultiView1.ActiveViewIndex = 0 End Sub

    It is also possible and sometimes important to script this action in the script together with the source code by adding the following to the source code between the <head/> <script/> sections. In this code the .vb page is devoid of any code.

    <script type="text/vbscript" runat="server"> Protected Overloads Sub 
    form1_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles form1.Load MultiView1.SetActiveView(View1) 'MultiView1.ActiveViewIndex = 0 End Sub </script>

    Yet another way of making View1 visible is to declaratively make it display in the attribute tag of the MultiView Control, as shown in a later example.

    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