CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

我想实现在留言本中 删除留言的功能。具体代码,哪位大虾能给提供。在线等。

楼主dearblue(蓝)2003-08-03 19:04:00 在 Web 开发 / ASP 提问

具体的代码。 问题点数:0、回复次数:5Top

1 楼bineon(雪冬寒)回复于 2003-08-03 19:55:44 得分 0

你应该能得到需要删除的留言的id,  
  sql="delete   表名   where   id="&request("id")  
  conn.execute  
  应该是这样吧,上面的sql不知道写的对不对,你试试!Top

2 楼ronanlin(旭)回复于 2003-08-04 00:50:02 得分 0

在删除留言的页面添加一个删除连接。  
  比较delete.asp?ID=<%=rs("ID")%>  
   
  然后在删除页面  
  sql="delete   表名   where   id="&request("ID")  
  应该就可以实现了吧。Top

3 楼ronanlin(旭)回复于 2003-08-04 00:51:44 得分 0

<!--#include   file="conn.asp"-->  
  <html>  
  <head>  
  <title>管理反馈信息</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <link   href="font.css"   rel="stylesheet"   type="text/css">  
  <script   language="javascript">  
  function   Delete(str){  
  if   (confirm("确定要删除吗?")){  
      window.location="DeleteFeedBack.asp?ID="+str;  
  }  
  }  
  </script>  
  </head>  
   
  <body   leftmargin="0"   topmargin="0"   marginwidth="0"   marginheight="0"   >  
  <table   width="100%"   height="100%"   border="0"   cellpadding="0"   cellspacing="0">  
      <tr>    
          <td   align="center"   valign="top">    
  <table   width="600"   border="0"   cellpadding="0"   cellspacing="0">  
                  <tr>    
                      <td>   <%  
  const   MaxPerPage=10 '第页最大显示产品数   3*5  
  if   not   isempty(request("page"))   then  
  currentPage=cint(request("page"))  
  else  
  currentPage=1  
  end   if  
  'queryitem=trim(request("Cname"))  
  sql="select   FeedBackID,CompanyName,Linkman,ContactPhone,Email,FeedBackContent,FeedBackTime   from   FeedBack   order   by   FeedBackTime   desc"  
  'response.Write(sql)  
  Set   rst=Server.CreateObject("ADODB.Recordset")  
  rst.open   sql,conn,3,3  
   
      if   rst.eof   and   rst.bof   then  
  %>   <script   language="javascript">  
  alert("暂时没有信息!");  
  window.location="FeedBack.asp"  
  </script>   <%        
  else  
        rst.pagesize=10  
              totalPut=rst.recordcount  
              if   currentpage<1   then  
                      currentpage=1  
              end   if  
              if   (currentpage-1)*MaxPerPage>totalput   then  
        if   (totalPut   mod   MaxPerPage)=0   then  
            currentpage=   totalPut   \   MaxPerPage  
        else  
              currentpage=   totalPut   \   MaxPerPage   +   1  
        end   if  
   
              end   if  
                if   currentPage=1   then  
                          showContent  
                else  
                      if   (currentPage-1)*MaxPerPage<totalPut   then  
                          rst.move     (currentPage-1)*MaxPerPage  
                          dim   bookmark  
                          bookmark=rst.bookmark  
                          showContent  
                  else  
                  currentPage=1  
                        showContent  
              end   if  
        end   if  
        rst.close  
        end   if  
                   
        set   rst=nothing      
        conn.close  
        set   conn=nothing  
       
   
        sub   showContent  
                dim   i  
        i=1  
  %>   <br>  
  <%for   i=1   to   rst.pageSize  
            if   rst.eof   then    
        exit   for  
        end   if    
  %>  
  <table   width="600"   height="100%"   border="0"   align="center"   cellpadding="0"   cellspacing="0">  
                           
      <tr>    
                                  <td   bgcolor="#000000"><table   width="600"   height="100%"   border="0"   align="center"   cellpadding="3"   cellspacing="1"   class="font">  
      <tr   bgcolor="#FFFFFF">    
          <td   width="50"   align="center">公司名称</td>  
          <td   width="300"><%=rst("CompanyName")%></td>  
          <td   width="50"   align="center">Email</td>  
          <td><%=rst("Email")%></td>  
          <td   width="50"   rowspan="4"   align="center"   valign="top"><a   href="javascript:Delete(<%=rst("FeedBackID")%>)">删除</a></td>  
      </tr>  
      <tr   bgcolor="#FFFFFF">    
          <td   align="center">联系人</td>  
          <td><%=rst("Linkman")%></td>  
          <td   align="center">反馈时间</td>  
          <td><%=rst("FeedBackTime")%></td>  
      </tr>  
      <tr   bgcolor="#FFFFFF">    
          <td   align="center">联系电话</td>  
          <td><%=rst("ContactPhone")%></td>  
          <td   align="center">&nbsp;</td>  
          <td>&nbsp;</td>  
      </tr>  
      <tr   bgcolor="#FFFFFF">    
          <td   align="center">反馈内容</td>  
          <td   colspan="3"><%=Replace(rst("FeedBackContent"),"&lt;br/&gt;","<br>")%>   </td>  
      </tr>  
  </table></td>  
                              </tr>  
                          </table><br>  
  <%  
      rst.movenext  
      next  
  %>   </td>  
                  </tr>  
                  <tr>    
                      <td><table   width="600"   border="0"   align="center"   cellpadding="0"   cellspacing="0"   class="font">  
                              <tr>    
                                  <td   align="center"></td>  
                              </tr>  
                              <tr>    
                                  <td   align="center">   <%  
        end   sub    
   
  function   showpage(totalnumber,maxperpage,filename)  
      dim   n  
      if   totalnumber   mod   maxperpage=0   then  
            n=   totalnumber   \   maxperpage  
      else  
            n=   totalnumber   \   maxperpage+1  
      end   if  
       
      response.write   "<form   method=Post   action="&filename&"   name=form2>"  
      %>   <%  
      if   CurrentPage<2   then  
          response.write   "<font   color='#666666'>[第一页]   [上一页]</font>   "  
      else  
          response.write   "<a   href="&filename&"?page=1><font   color=black>[第一页]</font></a>   "  
          response.write   "<a   href="&filename&"?page="&CurrentPage-1&"><font   color=black>[上一页]</font></a>   "  
      end   if  
      if   n-currentpage<1   then  
          response.write   "<font   color='#666666'>[下一页]   [最后一页]</font>"  
      else  
          response.write   "<a   href="&filename&"?page="&(CurrentPage+1)&">"  
          response.write   "<font   color=black>[下一页]</font></a>   <a   href="&filename&"?page="&n&"><font   color=black>[最后一页]</font></a>"  
      end   if  
        response.write   "<font   color='#000000'>   共有:</font><strong><font   color=red>"&CurrentPage&"</font><font   color='#000000'>/"&n&"</strong>页</font>   "  
        response.write   "<font   color='#000000'>共有:<b><font   color=red>"&totalnumber&"</font></b>条记录</font>   "  
        response.write   "   <font   color='#000000'></font><input   type='text'   name='page'   size=4   maxlength=10   class=smallInput   value="&currentpage&">"  
        response.write   "&nbsp;<input   type=submit   value='GOTO'class=font></span></form>"  
         
  end   function  
   
     
  %>   <%   showpage   totalput,MaxPerPage,"ViewFeedBack.asp"   %>   </td>  
                              </tr>  
                          </table></td>  
                  </tr>  
                   
              </table>  
   
                 
               
          </td>  
      </tr>  
  </table>  
  </body>  
  </html>  
  Top

4 楼ronanlin(旭)回复于 2003-08-04 00:52:05 得分 0

<!--#include   file="conn.asp"-->  
  <%  
  eID=Request("ID")  
  Set   rs=Server.CreateObject   ("ADODB.Recordset")  
  sql="select   FeedBackID   from   FeedBack   where   FeedBackID="&eID  
  rs.open   sql,conn,3,3  
   
  rs.delete  
  rs.close  
  set   rs=nothing  
  conn.close  
  set   conn=nothing  
  Response.Redirect   "ViewFeedBack.asp"  
   
  %>  
   
  Top

5 楼earthpea(问莲根,有丝多少?莲心知为谁苦?)回复于 2003-08-04 08:19:29 得分 0

只要定下了sql语句,其他什么都好说  
  sql   =   "delete   tablename   where   id   =   "   &   idTop

相关问题

  • 请教一个关于链表删除节点的疑问,具体问题写在代码的备注上
  • Assertion Failed 问题的困扰, delete pTermData(删除指针),具体代码如下,求助!!!
  • 怎样删除红色代码
  • 如何通过代码删除控件
  • 动态删除网页代码
  • 求JSP批量删除的代码
  • 求datagrid数据删除和删除确认的代码
  • 谁有留言版的源代码???
  • 求这个asp留言簿源代码!
  • 删除控件时,怎样连同它的代码一起删除?

关键词

  • 留言
  • totalput
  • maxperpage
  • currentpage
  • 反馈
  • 联系
  • then
  • else

得分解答快速导航

  • 帖主:dearblue

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo