内容显示页调用方法

来源:互联网 发布:与制工作室长板淘宝 编辑:程序博客网 时间:2024/05/17 02:17

内容页 前台Aspx

作者:<ahref="/usercenter/wodegaojian.aspx?uid=<%=ArticleModel.ArticlUser%>"><%=UserInstance.Instance.GetModelById(ArticleModel.ArticlUser).UserName%></a>

                    | 查看:<%=ArticleModel.ArticlDianJiShu%>

                    | 评论:<%=ArticleModel.ArticlPingLunShu%>

                    | 发表时间 :<%=Dqt.Reporter.Common.Util.UnixTimeToTimes(ArticleModel.ArticlTime.ToString(),"yyyy-MM-dd HH:mm")%></h2>

 <%=ArticleModel.ArticlTitleContent%>

------------------------------------------------------------------------------------------------------------------------------

Cs代码

内容页需要得到一个Model

public partialclass gaojian_view: System.Web.UI.Page

{

    Dqt.Reporter.BLL.articleArtcileBLL =new Dqt.Reporter.BLL.article();

    protected int ArticleId = 0;

    protectedDqt.Reporter.Model.article ArticleModel =null;

 

    protected void Page_Load(objectsender, EventArgs e)

    {

        if (string.IsNullOrEmpty(Request.QueryString["ArticleId"]) &&Dqt.Reporter.Common.MFunction.IsSaveStr(Request.QueryString["ArticleId"]))

        {

            return;

        }

        if (int.TryParse(Request.QueryString["ArticleId"],outArticleId))

        {

            ArticleModel =ArtcileBLL.GetModel(ArticleId);

            if(ArticleModel == null)

            {

                Response.Redirect("/");

            }

        }

        else

        {

            return;

        }

    }

}

0 0
原创粉丝点击