public void Search() { if (txtBrMobileS.Text == "" && txtBrIdS.Text == "" && TxtBrAddS.Text == "" && txtBrNameS.Text == "") { Show(" Plz Search By valid Data"); } try { int compid = 0; if (txtBrIdS.Text.ToString() != "") { compid = Convert.ToInt32(txtBrIdS.Text); } else { compid = 0; } string CompName; if (txtBrName.Text.ToString() != "") { CompName = txtBrName.Text.ToString(); } else { CompName = ""; } string mob; if (txtBrMobileS.Text.ToString() != "") { mob = txtBrMobileS.Text.ToString(); } else { mob = ""; } string add; if (TxtBrAddS.Text.ToString() != "") { add = TxtBrAddS.Text.ToString(); } else { add = ""; } var bb = BBLL.LoadBrProfileInfo(compid, CompName, mob, add); RptBr.DataSource = bb; RptBr.DataBind(); } catch { } }
private void Pageload() { PagedDataSource objPds = new PagedDataSource(); objPds.DataSource = BBLL.LoadBrProfileInfo(0, "", "", ""); objPds.AllowPaging = true; objPds.PageSize = 4; int CurPage; if (Request.QueryString["Page"] != null) { CurPage = Convert.ToInt32(Request.QueryString["Page"]); } else { CurPage = 1; } objPds.CurrentPageIndex = CurPage - 1; lblCurrentPage.Text = "Page: " + CurPage.ToString(); if (!objPds.IsFirstPage) { lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(CurPage - 1); } if (!objPds.IsLastPage) { lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(CurPage + 1); } RptBr.DataSource = objPds; RptBr.DataBind(); }