This topic illustrates how to add a back button to the C1ViewPort control's navigation bar in Design view, in Source view, and in code. This topic assumes that you have created an AJAX-enabled ASP.NET project that contains a ScriptManager control (see Creating an AJAX-Enabled ASP.NET Project) and a C1ViewPort control.
Note: Forward buttons won't appear at run time unless at least one list item has subitems.
In Design View
Complete the following steps:
1. Right-click the C1ViewPort control to open its context menu and then select Properties from the list.
The Properties window opens with C1ViewPort's properties in focus.
2. Expand the node for the RightButton property and set the following properties:
• Set the ID property to "Next".
• Set the Text property to "Next".
• Set the ButtonType property to Forward.
3. Save the project and open it in a Studio for iPhone-compatible browser.
In Source View
To add a forward button, place <Right Button ButtonType="Forward" Text="Next" CssClass="C1RightButton" id="Next"></LeftButton> between the <cc1:C1ViewPort> and </cc1:C1ViewPort> tags so that the markup resembles the following:
<cc1:C1ViewPort ID="C1ViewPort1" runat="server" Height="507px" ToolBarVisible="False" Width="320px">
<RightButton ButtonType="Forward" Text="Next" CssClass="C1RightButton" id="Next"></LeftButton>
</cc1:C1ViewPort>
Save the project and open it in a Studio for iPhone-compatible browser.
In Code
Complete the following steps:
1. Import the following namespace into your project:
Imports C1.Web.iPhone.C1ViewPort
•C#
using C1.Web.iPhone.C1ViewPort;
2. Add the following code to the Page_Load event to set the ID property:
C1ViewPort1.RightButton.ID = "Next"
•C#
C1ViewPort1.RightButton.ID = "Next";
3. Add the following code to the Page_Load event to set the Text property:
C1ViewPort1.RightButton.Text = "Next"
•C#
C1ViewPort1.RightButton.Text = "Next";
4. Add the following code to the Page_Load event to set the ButtonType property:
C1ViewPort1.RightButton.ButtonType = C1.Web.iPhone.C1Button.C1ButtonType.Forward
•C#
C1ViewPort1.RightButton.ButtonType = C1.Web.iPhone.C1Button.C1ButtonType.Forward;
5. Save the project and open it in a Studio for iPhone-compatible browser to execute the program.
This Topic
Illustrates the Following:
In this topic, you added a forward button to the header bar. The result should resemble the following image: