上一篇:利用c#制作简单的留言板(4) >>
利用c#制作简单的留言板(3)
<%@ Page language="c#" Codebehind="list.cs" AutoEventWireup="false" Inherits="notpage.list" %>
<html><head>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#"></head>
<body>
<form method="post" runat="server"></P><P> </form><a href = "addTopic.aspx">发表留言</a><br>
<TABLE WIDTH="90%" HEIGHT="1" BORDER="0" CELLSPACING="2" CELLPADDING="2" id=liuyan>
<TR>
<TD>主题</TD>
<TD>留言人</TD>
<TD>留言时间</TD>
</TR>
<asp:label id="n_tdtitle" runat=Server></asp:label>
</TABLE></P><P> </body></html>
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> </P><P>
/// <summary>
/// Summary description for list.
/// </summary>
public class list : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label n_tdtitle;
public list()
{
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 is required by the ASP+ Windows Form Designer.
//
InitializeComponent();
Init_tdtitle();
</P><P> }
</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);
}
protected void Init_tdtitle()
{
InitializeComponent();
//
// CODEGEN: This call is required by the ASP+ Windows Form Designer.
//
try
{
notepage np = new notepage();</P><P> ArrayList arrTopic = np.GetTopicList();
for ( int i = 0 ; i < arrTopic.Count ; i ++)
{
notepage objTopic = (notepage)arrTopic[i] ;
string str ="<tr><td><a href = showTopic.aspx?id="+objTopic.ID.ToString()+">" + objTopic.Title.ToString() + "</a></td>";
str = str +"<td>" + objTopic.Author.ToString()+"</td>";
str = str +"<td>" + objTopic.adddate.ToString()+"</td></tr>";
n_tdtitle.Text = str + n_tdtitle.Text;
}
}
catch(Exception e)
{
throw(new Exception("取得贴子列表出错:" + e.ToString())) ;
}</P><P> }
}
}
下一篇:利用c#制作简单的留言板(2) >>
相关文章:
- · C#实现的根据年月日计算星期几的函数
- · 汇总c#.net常用函数和方法集
- · 不要忽略c#中的using和as操作符
- · C#中关于GDI+输出的问题
- · 几个C# PROGRAMS
- · 几个C# PROGRAMS (2)
- · c#中的interface abstract与virtual
- · MapX从数据库读取数据形成新图层(C#)
- · C#对XML操作:建立XML(2)
- · C#对XML操作:建立XML(1)
- · C#调用父类的父类的方法
- · .NET中C#实现C/S架构下的TREEVIEW只需要输入表名,父ID,节点ID,节点名就可以得到树型结构
- · what is new in c sharp 2.0--study from msdn
- · C#设计模式之建造者(Builder)模式示例源代码
- · UBB(c#完整版)
- · c#中结构与类的区别
- · 三层结构
- · Destructors in C#
- · 链表类具有哈希表的功能
- · C#中委托,事件理解入门
- · Introduce event delegate
- · 替换以|分割的相同字符串
- · IOCP Thread Pooling in C#
- · C# struct class Differences
- · C#冒泡算法!
- · C#写的数据库操作类!
- · 快速开发vs.net+c#程序(-)
- · C#对XML操作:编辑XML文件内容
- · 用C#生成Excel文件的方法和Excel.dll组件生成的方法
- · 用C#实现Web文件的上传
- · C#编写的生成缩略图程序
- · 用一个留言簿说明C#操作XML的完全过程
- · 递归枚举排列、组合的C#源码
- · C#反编译微软MSDN2003的帮助文档,并将反编译结果保存到一个SQLSERVER数据库中
- · 用C#轻松在DOTNET中实现缩略图
- · c#中结构与类的区别
- · DES加密算法在C#下的实现
- · C#对XML操作:建立XML(3)
