Results 1 to 2 of 2

Thread: [RESOLVED] Header/Footer Templates

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    40

    Resolved [RESOLVED] Header/Footer Templates

    Hi there does nayone know how to add a footer to a mobile form. I need a back button to appear on all pages created by a lists pagnateion(pager). I need a button to appear on all paged pages allowing to go back to the first page.
    Anyone know hoe to do this I was told a footer template for the form would do this.

    Hope somone can help

    lee

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Header/Footer Templates

    Here's a simple example:
    The data grid
    Code:
           <asp:DataGrid ID="DataGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                PageSize="5" ShowFooter="True">
                <Columns>
                    <asp:TemplateColumn HeaderText="My Column">
                    <ItemTemplate>
                        <%#Container.DataItem("myColumn")%>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="btnPage1" runat=server OnClick="btnPage1_Click" Text="Page 1" />
                    </FooterTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
    The code behind
    VB Code:
    1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    2.         If Not Page.IsPostBack Then
    3.             BindData()
    4.         End If
    5.     End Sub
    6.  
    7.     Protected Sub BindData()
    8.         Dim dt As New Data.DataTable
    9.         dt.Columns.Add("myColumn")
    10.         dt.Rows.Add("1")
    11.         dt.Rows.Add("2")
    12.         dt.Rows.Add("3")
    13.         dt.Rows.Add("4")
    14.         dt.Rows.Add("5")
    15.         dt.Rows.Add("6")
    16.         dt.Rows.Add("7")
    17.         dt.Rows.Add("8")
    18.         dt.Rows.Add("9")
    19.         dt.Rows.Add("10")
    20.         dt.Rows.Add("11")
    21.         dt.Rows.Add("12")
    22.         dt.Rows.Add("13")
    23.         dt.Rows.Add("14")
    24.         dt.Rows.Add("15")
    25.         DataGrid1.DataSource = dt
    26.         DataGrid1.DataBind()
    27.     End Sub
    28.  
    29.     Protected Sub DataGrid1_PageIndexChanged _
    30.     (ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) _
    31.     Handles DataGrid1.PageIndexChanged
    32.  
    33.         DataGrid1.CurrentPageIndex = e.NewPageIndex
    34.         BindData()
    35.  
    36.     End Sub
    37.  
    38.     Protected Sub btnPage1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    39.  
    40.         DataGrid1.CurrentPageIndex = 0
    41.         BindData()
    42.  
    43.     End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width