国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

利用c#制作簡單的留言板 (3)

2024-07-21 02:20:21
字體:
來源:轉載
供稿:網友
菜鳥學堂:
顯示列表list.aspx
<%@ 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">

     </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>

  </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;

        


    /// <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);
        }

        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.
            //
            initializecomponent();
            init_tdtitle();
    

        }
        

        /// <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();

                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())) ;
            }

        }
    }
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浪卡子县| 台南县| 龙州县| 乳山市| 锦州市| 枣强县| 平原县| 南投县| 皋兰县| 金平| 辽阳县| 通化县| 温州市| 夏津县| 克什克腾旗| 岢岚县| 昌图县| 罗甸县| 南川市| 长葛市| 准格尔旗| 溧水县| 夹江县| 馆陶县| 茌平县| 城固县| 公主岭市| 乐山市| 焦作市| 龙里县| 泰顺县| 治多县| 黔西县| 普兰县| 衢州市| 威远县| 若尔盖县| 卓尼县| 邢台市| 新安县| 聂拉木县|