bbs.aspx.cs

来自「基于JSP+SQL Sever2000+Tomcat的网络服务器体系结构开发技术」· CS 代码 · 共 45 行

CS
45
字号
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 bbs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Server.Execute("pd.aspx");    
        GridView1.PageSize = odb.num("bbsnum");//设置每页显示的条目数
        
    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {//鼠标行为
        e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFC0C0'");
        e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
    }
    protected void GridView1_DataBound(object sender, EventArgs e)
    {
        foreach (GridViewRow gr in GridView1.Rows)
        {//显示是否有回复
            CheckBox chk = (CheckBox)gr.Cells[3].FindControl("CheckBox1");
            string lid = ((Label)gr.Cells[3].FindControl("Label4")).Text.ToString();
            if (Convert.ToInt32(odb.scr("select count(*) from [read] where [lid]=" + lid + "")) > 0)
            {
                chk.Checked = true;
                chk.Text = "已回复";
            }
            else
            {
                chk.Checked = false;
                chk.Text = "无回复";
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?