Dataliastpagenation

Jan 29 2016 11:54 AM
 plz tell me how to do this pagenation i dnt want any links just give me solution my prbm i searched many articles google so
 
 
 
 
<asp:DataList ID="dlImages" runat="server" RepeatColumns="4" CellPadding="5" style="margin-left:536px" >
<ItemTemplate>
<%--<a id="imageLink" href='<%# Eval("~/images/{0}") %>' title='<%#Eval("Description") %>' rel="lightbox[Brussels]" runat="server" >--%>
<asp:ImageButton ID="Image1" OnClick="Image1_Click" ImageUrl='<%# Container.DataItem %>' runat="server" Width="112" Height="84" />
</a>
</ItemTemplate>
<ItemStyle BorderColor="Brown" BorderStyle="dotted" BorderWidth="3px" HorizontalAlign="Center"
VerticalAlign="Bottom" />
</asp:DataList>
 
......................................
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindrepe();
}
}
public void bindrepe()
{
string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/images"));
List<String> images = new List<string>();
foreach (string item in filesindirectory)
{
images.Add(String.Format("~/images/{0}", System.IO.Path.GetFileName(item)));
}
images.Remove("~/images/blank.gif");
images.Remove("~/images/happy vans logo.png");
images.Remove("~/images/loading.gif");
Image1.ImageUrl = images[0];
dlImages.DataSource = images;
dlImages.DataBind();
}
protected void Image1_Click(object sender, ImageClickEventArgs e)
{
ImageButton pic = (ImageButton)sender;
string filename = pic.ImageUrl;
Image1.ImageUrl = filename;
}