HyperLesson/Student/Chosen-S.aspx.cs
(完整代码) 1KBusing BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HyperLesson
{
public partial class Chosen_S : System.Web.UI.Page
{
//数据绑定
private void Bind()
{
student stu = new student()
{
StudentNum = (Session["userinfo"] as student).StudentNum
};
GridView1.DataSource = ChosenManager.getList(stu);
GridView1.DataBind();
}
//跳转页面
protected void Turn_Click(object sender, EventArgs e)
{
if(((TextBox)GridView1.BottomPagerRow.FindControl("txtGoPage")).Text=="")
{
Response.Write("<script>alert('请输入需要跳转的页码!')</script>");
return;
}
GridView1.PageIndex = int.Parse(((TextBox)GridView1.BottomPagerRow.FindControl("txtGoPage")).Text) - 1;
Bind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bind();
Session["nowMax"]=this.GridView1.Rows.Count;
}
}
//分页
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
Bind();
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。