日期:2014-05-17 浏览次数:20523 次
public partial class Sousou : System.Web.UI.Page
{
int totalNum;
SqlMethod sqlmthd = new SqlMethod();
videoBL videoInfo = new videoBL();
protected void Page_Load(object sender, EventArgs e)
{
bindRepeater();
}
protected void searchBtn_Click1(object sender, EventArgs e)
{
videoInfo.videoPageProc(GridView1,this.TextBox1.Text,5,1,out totalNum);
bindRepeater();
}
#region 绑定Repeaer控件并生成页码数字
private void bindRepeater()
{
TextBox1.Text = totalNum.ToString();
DataTable dt = new DataTable();
dt.Columns.Add("page", typeof(int));
int i;
for (i = 1; i <= totalNum; i++)
{
DataRow drow = dt.NewRow();
drow["page"] = i;
dt.Rows.Add(drow);
}
Repeater2.DataSource = dt;
Repeater2.DataBind();
}
#endregion
public void lnkBtn_Click(object sender, EventArgs e)
{
LinkButton lbn = (LinkButton)sender;
videoInfo.videoPageProc(GridView1, this.TextBox1.Text, 5, Convert.ToInt32(lbn.CommandArgument), out totalNum);
}