asp.net.ph

MultiView.SetActiveView Method

System.Web.UI.WebControls Namespace   MultiView Class


Sets the specified View control as the active view within a MultiView control.

[ VB ]
Public Sub SetActiveView ( _
   view As View _
)

[ C# ]
public void SetActiveView (
   View view
)

[ C++ ]
void SetActiveView (
   View^ view
)
[ JScript ]
public void SetActiveView (
   View view
)

Parameters

view
A View control to set as the active view within a MultiView control.

Exceptions


Exception Type Condition
HttpException The specified view parameter value is not contained in the MultiView control.

Remarks

Use the SetActiveView method to specify a View control within a MultiView control as the active view.

Only one View control at a time can be defined as active within a MultiView control. The View control that is set as the active view is rendered to the client.

If a View control that does not exist within the MultiView control is set as active, an exception is raised at run time. If no View control is set as the active view, the MultiView control does not render any content to the client.

Using the SetActiveView method to programmatically set the active view allows the application to determine which View control to render to the client at run time based on criteria such as a user's identity and preferences.

Alternatively, the MultiView includes the ActiveViewIndex property to set or get the zero-based index of the current active view in a MultiView control. This property can be accessed either declaratively or programmatically.

Example

The following examples demonstrate using the SetActiveView method to set the active view in a MultiView control.

Nested MultiView Controls
Run Sample | View Source
Using the MultiView with the Toolbar WebControl
Run Sample | View Source
See Also

ActiveViewIndex Property   Navigating Views in the MultiView Control Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph