Popular Posts
Build an OpenVPN server on android device Preparation An android device, in this case, Sony xperia Z is used Root permission required Linux Deploy for deploy i... javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... SwiXml - Layout BorderLayout BorderLayoutPane.xml <?xml version="1.0" encoding="UTF-8"?> <panel layout="BorderLayout...
Stats
DataList paging
//利用PageDataSource來做分頁功能
PagedDataSource pds = new PagedDataSource();
//將PageDataSource綁定SqlDataSource
pds.DataSource = SqlDataSource1.Select(DataSourceSelectArguments.Empty);
pds.AllowPaging = true;
// 分頁大小
pds.PageSize = 6;

int PageIndex;
//分頁參數
if (!string.IsNullOrEmpty(Request.QueryString["Page"]) && int.TryParse(Request.QueryString["Page"], out PageIndex))
{
    PageIndex = Convert.ToInt32(Request.QueryString["Page"]);
}
else
{
    PageIndex = 1;
}

pds.CurrentPageIndex = PageIndex - 1;

// 最後一頁
if (!pds.IsLastPage)
{
    hlNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(PageIndex + 1);
    if (Request.QueryString["type"] != null) hlNext.NavigateUrl += "&type=" + Request.QueryString["type"];
}
else
{
    hlNext.Visible = false;
}


//將DataList綁定PageDataSource
this.DataList1.DataSource = pds;
this.DataList1.DataBind();