In this topic, you will learn how to add an anchor in Design view, in Source view, and in code.
In Design View
Complete the following steps:
1.
Click the smart tag () to open the
C1ViewScroller Tasks menu.
2. Click the C1ViewScroller Designer link.
The C1ViewScroller Designer Form opens.
3.
Click the Add Child Item button to add an anchor (C1ScrollerItem)
to the C1ViewScroller
control.
4. Select the newly created item and change TopOffset property whatever value you wish.
5. Click OK to close the C1ViewScroller Designer Form.
In Source View
To add an anchor to the C1ViewScroller control, place the following markup between the <C1ViewScroller> and </C1ViewScroller> tags:
<Items>
<C1ViewScroller:C1ScrollerItem runat="server" ScrollToId="" Text="A"
/>
</Items>
In Code
Complete the following steps:
1. Add the following code to the Page_Load event:
'Create a new C1ScrollerItem and set its text
Dim C1ScrollerItem_New As New C1ScrollerItem()
C1ScrollerItem_New.Text = "A"
'Add the new C1ScrollerItem to the C1ViewScroller control
C1ViewScroller1.Items.Add(C1ScrollerItem_New)
•C#
C1ViewScroller1.ScrollTargetId = "C1NavigationList1";
//Create a new C1ScrollerItem and set its text
C1ScrollerItem C1ScrollerItem_New = new C1ScrollerItem();
C1ScrollerItem_New.Text = "A";
//Add the new C1ScrollerItem to the C1ViewScroller control
C1ViewScroller1.Items.Add(C1ScrollerItem_New);
2. Save the project and open it in a Studio for iPhone-compatible browser to execute the program.