📄 stuactivityinfo.aspx.cs
字号:
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;
public partial class student_stuactivityinfo : System.Web.UI.Page
{
public int allpage = 10;
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session["Student"].ToString()!= "true")
{
Response.Write("<script>parent.window.href=\"../login.aspx\"</script>");
Response.End();
}
}
catch
{
Response.Write("<script>parent.window.href=\"../login.aspx\"</script>");
Response.End();
}
if (!IsPostBack)
{
DataTable reader = Student.Student.GetActivityInfo();
if (reader != null)
allpage = reader.Rows.Count;
else allpage = 0;
}
}
public void PrintReport()
{
int pageid = 0;
try
{
pageid = Convert.ToInt32(Request["pageid"]);
}
catch (Exception ex)
{
pageid =0;
Response.Write(ex.Message);
}
try
{
DataTable reader = Student.Student.GetActivityInfo();
if (reader != null)
{
for (int i = pageid * 10, j = 0; i < reader.Rows.Count && j < 10; i++, j++)
{
Response.Write("<tr>");
Response.Write("<td width=\"20%\" align=right class=mode4 style=\"height: 23px\">学生活动:</td>");
Response.Write("<td width=\"72%\" align=left class=mode5 style=\"height: 23px\"><div align=\"center\">" + reader.Rows[i]["ActivityName"].ToString() + "</div></td>");
Response.Write("<td width=\"8%\" align=left class=mode5 style=\"height: 23px\"><div align=\"center\"><a href=\"#\" OnClick=\"showModalDialog('activitydetailinfo.aspx?activityid=" + reader.Rows[i]["ActivityID"].ToString() + "',' ','dialogHeight:490px;dialogWidth:650px')\">查看</a></div></td>");
Response.Write("</tr>");
}
page_1.Text = "当前是第" + pageid.ToString() + "页";
allpage = reader.Rows.Count / 10 + 1;
page_all.Text = "共" + Convert.ToString(allpage) + "页";
}
}
catch (Exception ex)
{
Response.Write("<script> alert(\'" + ex.Message + "\')</script>");
}
}
public void PrintPage()
{
for (int i = 0; i < allpage; i++)
{
Response.Write("<a href=stuactivityinfo.aspx?pageid=" + i.ToString() + ">" + i.ToString() + " </a>\n");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -