DesktopModules/Student/StudentManage.aspx.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using StudentManager;
using SQLHelper;
public partial class StudentManage : System.Web.UI.Page
{
protected void Page_Load(object sender,EventArgs e)
{
if (!Page.IsPostBack)
{
///绑定控件的数据
BindStudentData();
}
///添加删除确认对话框
deleteBtn.Attributes.Add("onclick","return confirm('" + ASPNET2System.OPERATIONDELETEMESSAGE + "');");
}
private void BindStudentData()
{
///定义获取数据的类
Student student = new Student();
SqlDataReader recd = student.GetStudents();
///设定控件的数据源
StudentList.DataSource = recd;
///设定控件的Text属性和Value属性
StudentList.DataTextField = "Name";
StudentList.DataValueField = "StudentID";
///绑定控件的数据
StudentList.DataBind();
///关闭数据读取器和数据库的连接
recd.Close();
}
protected void AddBtn_Click(object sender,EventArgs e)
{
///跳转到添加页面
Response.Redirect("~/DesktopModules/Student/AddStudent.aspx");
}
protected void editBtn_Click(object sender,ImageClickEventArgs e)
{
if (StudentList.SelectedIndex > -1)
{
///跳转到查看页面
Response.Redirect("~/DesktopModules/Student/UpdateStudent.aspx?StudentID=" + StudentList.SelectedValue);
后面还有 40 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
