Making simple message boards with C # (4)

Source: Internet
Author: User
View message Content Showtopic.aspx
<%@ page language= "C #" codebehind= "ShowTopic.cs" autoeventwireup= "false" inherits= "Notpage.showtopic"%>
<meta content= "Microsoft Visual Studio 7.0" name=generator>
<meta content=c# name=code_language><body>
<form method=post runat= "Server" >
<p align=center><font color=red><b> View message </b></font></p><br>
<p align=left><font color=blue> Message topic: <asp:label id=n_tdtitle runat= "Server" forecolor= "Black" >< /asp:label>
<br> message time: <asp:label id=n_tdadddate runat= "Server" forecolor= "Black" ></asp:label><br></ Font><font color=blue> Message Person:
<asp:label
Id=n_tdauthor runat= "Server" forecolor= "Black" ></asp:label><br> message content: <asp:label id=n_tdcontent
runat= "Server" forecolor= "Black" ></asp:label> </font></p></form>

</body>The corresponding 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;</p><p>//<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);
}</p><p> protected void Page_Load (object sender, EventArgs e)
{
if (! IsPostBack)
{
//
Evals true first time browser hits the page
//
}
}</p><p> protected void Page_Init (object sender, EventArgs e)
{
//
Codegen:this call was 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 ();
}</p><p>//<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);
}
}
}

The above is the use of C # to make a simple message board (4) of the content, more relevant articles please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.