⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbscontent.aspx.cs

📁 精通网络应用系统开发 光盘 该书是人民邮电出版社出版的
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Linq;
using System.Collections.Generic;

public partial class DesktopModules_BBS_BBSContent : System.Web.UI.Page
{
    int nTitleID = -1;
    protected void Page_Load(object sender, EventArgs e)
    {   ///获取参数的值
        if (Request.Params["TitleID"] != null)
        {
            nTitleID = Int32.Parse(Request.Params["TitleID"].ToString());
        }
        if (!Page.IsPostBack)
        {   ///绑定控件的数据
            if (nTitleID > -1)
            {
                BindContentData(nTitleID);
                UpdateVisitNum(nTitleID);
            }
        }
    }
    private void BindContentData(int nTitleID)
    {   ///定义类
        ContentM content = new ContentM();
        ///获取数据
        IList<Content> recc = content.GetContentByTitle(nTitleID);
        ///绑定控件的数据
        ContentList.DataSource = recc;
        ContentList.DataBind();
    }
    private void UpdateVisitNum(int nTitleID)
    {
        try
        {
           TitleM title = new TitleM();
            title.UpdateTitleVisitNum(nTitleID);
        }
        catch (Exception ex)
        {   ///显示操作中的失败、错误信息
            Response.Redirect("~/DesktopModules/ErrorPage.aspx?ErrorUrl="
                + ASPNET35System.RedirectErrorUrl(Request.RawUrl)
                + "&ErrorMessage=" + ex.Message.Replace("\n", " "));
        }
    }
    protected string FormatBody(string sBody)
    {
        return (sBody.Replace("\n", "<br>"));
    }


}

⌨️ 快捷键说明

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