亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > ASP > 正文

reply.aspx 瀏覽貼子內容及回復

2024-05-04 11:06:25
字體:
來源:轉載
供稿:網友

2) reply.aspx : the topic viewing and replying page

<%@ page language="c#" enablesessionstate="false" debug="true" %>
<%@ import namespace="system" %>
<%@ assembly name="system.data" %>
<%@ import namespace="system.data" %>
<%@ import namespace="system.data.ado" %>
<html><head>
<title>post new topic.</title>
<%-- these are the imported assemblies and namespaces needed --%>
<script language="c#" runat="server">
  dataset ds ,rs;
  datarow dr ;
  string postid ;
  public void page_load(object sender , eventargs e)
  {
     //check if the page is post back
     if(!page.ispostback)
    {
       //get the postid from the query string
       postid = request.params["postid"] ;
       if(postid!=null)
      {
         //database connection string. change the path to the database file if you have some other path where
         //you are saving your database file
         string [email protected]"provider=microsoft.jet.oledb.4.0 ;data source="+server.mappath(".//db//board.mdb") ;
         //make a connection to the database
         adoconnection myconn = new adoconnection(strconn) ;
         //string to select the records from the newpost table
         string strcon ="select subject, name, email, message ,date  from newpost where postid="+postid ;
          //set a adodatasetcommand
         adodatasetcommand mycommand =new adodatasetcommand(strcon,myconn);
         ds = new dataset();
         //don't ever forget to open the connection
         myconn.open();
         //fill the dataset
         mycommand.filldataset(ds,"newpost") ;
         //get the row at position '0' and store it in a datarow object
         //why row at position '0' ? since there can only be one record with the given postid remember !!
         //why put into a datarow ? its easy to access data from a datarow
         dr = ds.tables["newpost"].rows[0] ;
         //get the "subject" from the datarow and set it up in the post reply form's subject field
         subject.text="re:"+dr["subject"].tostring() ;
         //select the replies to the post from the reply table
         strcon ="select name , email, subject, message ,date from reply where postid="+postid ;
         //make a new adodatasetcommand and dataset for the reply table
         adodatasetcommand mycommand2 =new adodatasetcommand(strcon,myconn);
         rs = new dataset() ;
         //fill the dataset
         mycommand2.filldataset(rs, "reply") ;
         //code to update the "views" field for the newpost table
         //select the views field from the table for a given postid
         strcon ="select views from newpost where postid = "+postid ;
         //make a adocommand here since we want a adodatareader later
         adocommand vicomm = new adocommand(strcon, myconn) ;
         adodatareader reader ;
         //execute the statement and create a adodatareader
         vicomm.execute(out reader) ;
         //read the first record (there can only be one record remember !)
         reader.read() ;
         //get a "int32" value from the first column (we have one column in the reader, check the select statement above)
         int i = reader.getint32(0) ;
         //increase the views count
         i++ ;
         reader.close() ;
         //update the newpost table with the new views value
         strcon ="update newpost set views = "+i+" where (postid= "+postid+")" ;
         //since we are using the same adocommand object for this statement too to set the commandtext property
         vicomm.commandtext = strcon ;
         //since this statement will result in no output we use "executenonquery()" method
         vicomm.executenonquery() ;
         //close the connection
         myconn.close();
      }
    }
  }
   // this method is called when the submit button is clicked
   public void submit_click(object sender, eventargs e)
   {
       //get the postid
       postid = request.params["postid"] ;
       
       //proceed only if all the required fields are filled-in
       if(page.isvalid&&name.text!=""&&subject.text!=""&&email.text!=""){
         datetime now = datetime.now ;
         errmess.text="" ;
        //we have to call the postmessage.aspx page with a query to post the data to the database.
        //hence we have to first build the custom query from the data posted by the user
        //also since we are using a query we have to encode the data into utf8 format
         string req = "name="+ system.web.httputility.urlencodetostring(name.text, system.text.encoding.utf8);
        req+="&&email="+ system.web.httputility.urlencodetostring(email.text, system.text.encoding.utf8);
        req+="&&subject="+system.web.httputility.urlencodetostring(subject.text, system.text.encoding.utf8);
req+="&&ip="+system.web.httputility.urlencodetostring(request.userhostaddress.tostring(), system.text.encoding.utf8);
        req+="&&date="+ system.web.httputility.urlencodetostring(now.tostring(), system.text.encoding.utf8);
        req+="&&message="+ system.web.httputility.urlencodetostring(message.text, system.text.encoding.utf8);
        //encode "no" to indicate that the post is not a new post but its a reply to a earlier message
        req+="&&newpost="+ system.web.httputility.urlencodetostring("no", system.text.encoding.utf8);
        req+="&&previd="+ system.web.httputility.urlencodetostring(postid, system.text.encoding.utf8);
         //call the postmessage page with our custom query
         page.navigate("postmessage.aspx?" + req);
       }
       else
       {
          errmess.text="fill in all the required fields !" ;
        }
    }
</script>
<link href="mystyle.css" type=text/css rel=stylesheet></head>
<body topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">
<%-- include a header file 'header.inc' --%>
<!-- #include file="header.inc" -->
<br>
<div align=center>
<table border=0 width=80% cellspacing=2>
<tr class=fohead><th width=20%>author name</th>
<th width=80%>message</th></tr>
<%-- below i am encapsulating the email of the author over the name of the author
so that when you click on the author a e-mail gets sent to him
also i am geting the datetime from the database and displaying the date and time separately --%>   
<tr class=folight><td rowspan=2 align="center"><%= "<a href=mailto:"+dr["email"]+">"+dr["name"]+"</a>" %><br>
<font size=1><%= dr["date"].tostring().todatetime().toshortdatestring()  %><br>
<%= dr["date"].tostring().todatetime().toshorttimestring() %></font>
</td>
<td><b>subject: </b><%=dr["subject"] %></td></tr>
<tr class=folight>
<td><pre><%=dr["message"] %></pre> </td>
</tr>
<%-- get all the replies to the original post and show them --%>
<% int no = rs.tables["reply"].rows.count ;
   if(no>0)
   {
      for(int j=0 ;j<no ; j++)
      {
          datarow rd = rs.tables["reply"].rows[j] ;
%>
<tr class=fodark>
<td align="center"><%="<a href=mailto:"+rd["email"]+">"+rd["name"]+"</a>" %><br>
<font size=1><%= rd["date"].tostring().todatetime().toshortdatestring()  %><br>
<%= rd["date"].tostring().todatetime().toshorttimestring() %></font>
</td>
<td><pre><%=rd["message"] %></pre> </td>
</tr>
<%
        }
    }
%>
</table>
</div>
<h3 align="center" class="fodark"><a href=forum.aspx>click here</a> to go to back to forum.
<br>reply to the above post.</h3>
<br>
<asp:label id="errmess" text="" style="color:#ff0000" runat="server" />
<form runat="server">
<table border="0"  width="80%" align="center">
<tr >
<td class="fohead" colspan=2><b>reply to the post</b></td>
</tr>
<tr class="folight" >
<td>name :</td>
<td ><asp:textbox text="" id="name" runat="server" />   <font color=#ff0000>*</font></td>
</tr>
<tr class="folight">
<td>e-mail :</td>
<td><asp:textbox text="" id="email" runat="server"/>   <font color=#ff0000>*</font></td>
</tr>
<tr class="folight">
<td> subject:</td>
<td><asp:textbox test="" id="subject" width=200 runat="server"/>   <font color=#ff0000>*</font>
</td></tr>
<tr class="folight">
<td>message :</td>
<td>
<asp:textbox id=message runat="server"
columns="30" rows="15" textmode="multiline"></asp:textbox></td>
</tr>
<tr class=folight>
<td colspan=2>
<asp:button class=fodark id=write onclick=submit_click runat="server" text="submit"></asp:button></td></tr>
</table>
</form><br>
<br><!-- #include file="footer.inc" -->
</body></html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
伊是香蕉大人久久| 欧美日韩在线看| 色偷偷av亚洲男人的天堂| 最近2019免费中文字幕视频三| 黑人巨大精品欧美一区二区一视频| 国产精品免费久久久久久| 国产亚洲aⅴaaaaaa毛片| 亚洲jizzjizz日本少妇| 欧美老女人www| 中文字幕久热精品在线视频| 欧美成人激情视频免费观看| 91免费看国产| 亚洲久久久久久久久久久| 在线观看久久久久久| 亚洲嫩模很污视频| 日韩高清中文字幕| 美女福利视频一区| 久久国内精品一国内精品| 国产精品99久久久久久白浆小说| 国产成人综合精品在线| 国产精品久久久久久久久影视| 欧美成人激情在线| 国产亚洲欧洲高清一区| 国产精品网站入口| 在线观看欧美日韩国产| 成人免费看吃奶视频网站| 久久久综合av| 国产在线播放不卡| 日韩在线一区二区三区免费视频| 国产成人综合精品在线| 久久久精品一区| 热久久99这里有精品| 欧美一区亚洲一区| 欧美视频在线观看 亚洲欧| 精品一区二区三区三区| 九九九久久国产免费| 最近2019好看的中文字幕免费| 中文字幕日韩在线观看| 日韩中文字幕在线| 亚洲欧洲中文天堂| 高潮白浆女日韩av免费看| 欧美成人在线免费视频| 久久久欧美一区二区| 国产精品一区久久| 欧美高清视频在线观看| 亚洲一区二区三区乱码aⅴ蜜桃女| 色哟哟网站入口亚洲精品| 欧美高清视频免费观看| 日韩免费视频在线观看| 国产精品高潮呻吟视频| 亚洲精品xxx| 91精品久久久久久久久青青| 欧美最猛黑人xxxx黑人猛叫黄| 欧美精品在线免费观看| 欧美日韩免费网站| 国产精品福利网站| 日韩网站免费观看| 国产精品电影网站| 久久91亚洲精品中文字幕| 国产成人在线一区| 国产日韩精品在线| 欧美在线国产精品| 亚洲高清不卡av| 成人在线中文字幕| 欧美自拍视频在线观看| 精品视频久久久久久久| 亚洲欧美在线磁力| 国产午夜精品美女视频明星a级| 欧美日韩免费在线观看| 亚洲欧洲自拍偷拍| 欧美日韩一区二区在线播放| 久久成人综合视频| 欧美日韩人人澡狠狠躁视频| 欧美另类高清videos| 亚洲综合中文字幕68页| 日日摸夜夜添一区| 国产欧美日韩精品丝袜高跟鞋| 欧美电影《睫毛膏》| 久久久国产影院| 亚洲色图综合网| 国产精品麻豆va在线播放| 日韩在线一区二区三区免费视频| 欧美刺激性大交免费视频| 91极品女神在线| 成人久久一区二区| 国产精品丝袜久久久久久不卡| 亚洲小视频在线观看| 狠狠躁天天躁日日躁欧美| 国产精品久久久久久中文字| 国产一区二区三区直播精品电影| 91精品视频网站| 中文欧美日本在线资源| 少妇激情综合网| 欧美俄罗斯乱妇| 日韩精品电影网| 欧美性猛交xxxx乱大交3| 亚洲国产精品资源| 隔壁老王国产在线精品| 7m第一福利500精品视频| 亚洲天堂免费观看| 91成人免费观看网站| 2019中文字幕在线免费观看| 97碰在线观看| 欧美夫妻性生活视频| 性色av一区二区三区红粉影视| 欧美性猛交xxxx乱大交3| 国内精品久久久久影院优| 欧美高跟鞋交xxxxxhd| 欧美日韩午夜视频在线观看| 欧美激情网站在线观看| 欧美成人免费网| 中文字幕欧美精品在线| 亚洲精品日韩久久久| 日本高清久久天堂| 日本精品一区二区三区在线播放视频| 国产精品免费视频久久久| 91精品久久久久久久久久| 亚洲精品自产拍| 色噜噜亚洲精品中文字幕| 亚洲天堂av在线播放| 国产成人免费91av在线| 成人精品网站在线观看| 欧美怡红院视频一区二区三区| 久久久久久久久久久91| 亚洲欧美在线免费观看| 欧美亚洲免费电影| 欧美激情精品久久久久久黑人| 最近2019年好看中文字幕视频| 国外色69视频在线观看| 欧美日韩另类字幕中文| 性色av一区二区三区| 国模精品视频一区二区三区| 欧美一级免费看| 亚洲免费一级电影| 成人动漫网站在线观看| 亚洲自拍另类欧美丝袜| 大荫蒂欧美视频另类xxxx| 永久免费看mv网站入口亚洲| 久久久久久12| 一本色道久久88综合亚洲精品ⅰ| 中文字幕精品av| 国产精品jvid在线观看蜜臀| 国产精品久久精品| 777精品视频| 九九热精品视频| 欧美亚洲国产日韩2020| 亚洲国产天堂网精品网站| 久久久女女女女999久久| 久久天天躁夜夜躁狠狠躁2022| 亚洲影视九九影院在线观看| 国产精品久久久久久网站| 欧美成年人视频| 精品福利樱桃av导航| 91国内在线视频| 欧美精品一本久久男人的天堂| 国产伊人精品在线| 亚洲精品久久久久中文字幕二区| 国内免费精品永久在线视频| 国产精品久久久999| 美乳少妇欧美精品| 国产精品青青在线观看爽香蕉| 2018国产精品视频| 影音先锋欧美在线资源| 伊人伊成久久人综合网站|