[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
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:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Protected Sub BindData()
Dim dt As New Data.DataTable
dt.Columns.Add("myColumn")
dt.Rows.Add("1")
dt.Rows.Add("2")
dt.Rows.Add("3")
dt.Rows.Add("4")
dt.Rows.Add("5")
dt.Rows.Add("6")
dt.Rows.Add("7")
dt.Rows.Add("8")
dt.Rows.Add("9")
dt.Rows.Add("10")
dt.Rows.Add("11")
dt.Rows.Add("12")
dt.Rows.Add("13")
dt.Rows.Add("14")
dt.Rows.Add("15")
DataGrid1.DataSource = dt
DataGrid1.DataBind()
End Sub
Protected Sub DataGrid1_PageIndexChanged _
(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) _
Handles DataGrid1.PageIndexChanged
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindData()
End Sub
Protected Sub btnPage1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
DataGrid1.CurrentPageIndex = 0
BindData()
End Sub