Adding Arbitrary Controls to C1Splitter
You can add arbitrary controls to each panel of the C1Splitter control using a simple drag-and-drop operation or HTML. In this topic, you will add a Button control to Panel1 and a TextBox control to Panel2.
In Design View
Complete the following steps:
1. Add a C1Splitter control to your Web project.
2. Select a Button control from the Visual Studio Toolbox and drag it into the Panel1.
3. Select a TextBox control from the Visual Studio Toolbox and drag it into Panel2.
In Source View
Complete the following steps:
1. Add a C1Splitter control to your Web project.
2. Click the Source tab to enter Source view.
3. Locate the <Panel1> tags and place the following tag between them:
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
4. Locate the <Panel2> tags and place the following tag between them:
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ContentTemplate>
In Code
Complete the following steps:
1. Add a C1Splitter control to your Web project.
2. Select a PlaceHolder control from the Visual Studio Toolbox and drag it into the Panel1.
PlaceHolder1 appears in Panel1.
3. Select a PlaceHolder control from the Visual Studio Toolbox and drag it into the Panel2.
PlaceHolder2 appears in Panel2.
4. In the Solution Explorer window, right-click on the project and select View Code to enter the code editor.
5. Create a Button control and add text to it by entering the following code to the Page_Load event:
Dim nuButton As Button = New Button()
nuButton.Text = "Hello World!"
• C#
Button nuButton = new Button();
nuButton.Text = "Hello World!";
6. Create a TextBox control:
Dim nuTextBox As TextBox = New TextBox()
• C#
TextBox nuTextBox = new TextBox();
7. Add the Button control to the PlaceHolder1:
PlaceHolder1.Controls.Add(nuButton)
• C#
PlaceHolder1.Controls.Add(nuButton);
8. Add the TextBox control to PlaceHolder2:
PlaceHolder2.Controls.Add(nuTextBox)
• C#
PlaceHolder2.Controls.Add(nuTextBox);
9. Run the program.
This Topic Illustrates the
Following:
The following graphic depicts a C1Splitter control with a Button control in Panel1 and a TextBox control in Panel2.
|