利用c#制作简单的留言板 (4)

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
查看留言内容showtopic.aspx
<%@ Page language="c#" Codebehind="showTopic.cs" AutoEventWireup="false" Inherits="notpage.showTopic" %>
<html><head>
<meta content="Microsoft Visual Studio 7.0" name=GENERATOR>
<meta content=C# name=CODE_LANGUAGE></head>
<body>
<form method=post runat="server">
<p align=center><font color=red><b>察看留言</b></font></p><br>
<p align=left><font color=blue>留言主题:<asp:label id=n_tdtitle runat="Server" forecolor="Black"></asp:label>
<br>留言时间:<asp:label id=n_tdAdddate runat="Server" forecolor="Black"></asp:label><br></font><font color=blue>留言人:
<asp:label
id=n_tdAuthor runat="server" forecolor="Black"></asp:label><br>留言内容:<asp:label id=n_tdContent
runat="Server" forecolor="Black"></asp:label> </font></p></form>
    
  </body></html>
对应的cs
namespace notpage
{
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;

    /// <summary>
    ///    Summary description for showTopic.
    /// </summary>
    public class showTopic : System.Web.UI.Page
    {
        protected System.Web.UI.WebControls.Label n_tdAuthor;
        protected System.Web.UI.WebControls.Label td;
        protected System.Web.UI.WebControls.Label n_tdContent;
        protected System.Web.UI.WebControls.Label n_tdAdddate;
        protected System.Web.UI.WebControls.Label n_tdtitle;
        protected System.Web.UI.WebControls.Label n_ttitle;
    
    public showTopic()
    {
        Page.Init += new System.EventHandler(Page_Init);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //
                // Evals true first time browser hits the page
                //
            }
        }

        protected void Page_Init(object sender, EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP+ Windows Form Designer.
            //
            int int_ID;
            int_ID = Request.QueryString["ID"].ToInt32();
            notepage np = new notepage();
            notepage objNp = np.GetTopic(int_ID);
            n_tdtitle.Text = objNp.Title.ToString();
            n_tdContent.Text = objNp.Content.ToString();
            n_tdAuthor.Text = objNp.Author.ToString();
            n_tdAdddate.Text = objNp.adddate.ToString();
            InitializeComponent();
        }

        /// <summary>
        ///    Required method for Designer support - do not modify
        ///    the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Load += new System.EventHandler (this.Page_Load);
        }
    }<

seover="window.status='正文--利用c# 制作简单留言板 (4)';return true">
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值