Represents a Mobile control that acts as a container for other controls.
Assembly: FiftyOne.Framework (in FiftyOne.Framework.dll) Version: 2.0.2.1 (2.0.2.1)
Syntax
| C# |
|---|
[ToolboxBitmapAttribute("FiftyOne.Framework.Mobile.Controls.Panel")] [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class Panel : Panel, IStyle, IUrlResolutionService, ICssIncludeGroup, IAllowStyleAttributes |
| Visual Basic |
|---|
<ToolboxBitmapAttribute("FiftyOne.Framework.Mobile.Controls.Panel")> _ <AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _ Public Class Panel _ Inherits Panel _ Implements IStyle, IUrlResolutionService, ICssIncludeGroup, IAllowStyleAttributes |
| Visual C++ |
|---|
[ToolboxBitmapAttribute(L"FiftyOne.Framework.Mobile.Controls.Panel")] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class Panel : public Panel, IStyle, IUrlResolutionService, ICssIncludeGroup, IAllowStyleAttributes |
Examples
The following example illustrates the use of a Panel control to generate controls programmatically and to hide/show a group of controls.
<mob:Panel id="Panel1" runat="server" BackColor="gainsboro" Height="200px" Width="300px" > Panel1: Here is some static content... <br /> <mob:Panel> Generate Labels: <mob:DropDownList id="DropDown1" runat="server"> <asp:ListItem Value="0">0</asp:ListItem> <asp:ListItem Value="1">1</asp:ListItem> <asp:ListItem Value="2">2</asp:ListItem> <asp:ListItem Value="3">3</asp:ListItem> <asp:ListItem Value="4">4</asp:ListItem> </mob:DropDownList> <br /> Generate TextBoxes: <mob:DropDownList id="DropDown2" runat="server"> <asp:ListItem Value="0">0</asp:ListItem> <asp:ListItem Value="1">1</asp:ListItem> <asp:ListItem Value="2">2</asp:ListItem> <asp:ListItem Value="3">3</asp:ListItem> <asp:ListItem Value="4">4</asp:ListItem> </mob:DropDownList> <br /> <mob:CheckBox id="Check1" Text="Hide Panel" runat="server"/> <br /> <mob:Button Text="Refresh Panel" runat="server"/>
protected void Page_Load(Object sender, EventArgs e) { // Show or hide the Panel contents. if (Check1.Checked) { Panel1.Visible=false; } else { Panel1.Visible=true; } // Generate the Label controls. int numlabels = Int32.Parse(DropDown1.SelectedItem.Value); for (int i=1; i<=numlabels; i++) { Label l = new Label(); l.Text = "Label" + (i).ToString(); l.ID = "Label" + (i).ToString(); Panel1.Controls.Add(l); Panel1.Controls.Add(new LiteralControl("<br />")); } // Generate the Textbox controls. int numtexts = Int32.Parse(DropDown2.SelectedItem.Value); for (int i=1; i<=numtexts; i++) { TextBox t = new TextBox(); t.Text = "TextBox" + (i).ToString(); t.ID = "TextBox" + (i).ToString(); Panel1.Controls.Add(t); Panel1.Controls.Add(new LiteralControl("<br />")); } }
Inheritance Hierarchy
System..::..Object
System.Web.UI..::..Control
System.Web.UI.WebControls..::..WebControl
System.Web.UI.WebControls..::..Panel
FiftyOne.Framework.Mobile.Controls..::..Panel
System.Web.UI..::..Control
System.Web.UI.WebControls..::..WebControl
System.Web.UI.WebControls..::..Panel
FiftyOne.Framework.Mobile.Controls..::..Panel