Popular Posts
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... Close window without confirm (I.E only) window.opener=null; window.open('','_self'); window.close(); focus on validating function focusOnInvalidControl() {     for (var i = 0; i < Page_Validators.length; i++) {         if (!Page_Validators[i].isvalid) {     ...
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();