| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2372 人关注过本帖
标题:请教大神帮助,网页可以增加,删除,就是不能修改,不知道那儿错了,请高手 ...
只看楼主 加入收藏
ie6ant
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2015-9-11
结帖率:0
收藏
已结贴  问题点数:20 回复次数:4 
请教大神帮助,网页可以增加,删除,就是不能修改,不知道那儿错了,请高手帮下忙
<!--#include file="../Include/Conn.asp" -->
<!--#include file="seeion.asp"-->
<%call chkAdmin(17)%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<title>业务分类管理</title>
<link rel="stylesheet" href="../zycheditor/plugins/code/prettify.css" />
<script charset="utf-8" src="../zycheditor/kindeditor.js"></script>
<script charset="utf-8" src="../zycheditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../zycheditor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
  var editor1 = K.create('textarea[name="body"]', {
      cssPath : '../zycheditor/plugins/code/prettify.css',
      uploadJson : '../zycheditor/asp/upload_json.asp',
      fileManagerJson : '../zycheditor/asp/file_manager_json.asp',
      allowFileManager : true,
      afterCreate : function() {
          var self = this;
          K.ctrl(document, 13, function() {
              self.sync();
              K('form[name=add]')[0].submit();
          });
          K.ctrl(self.edit.doc, 13, function() {
              self.sync();
              K('form[name=add]')[0].submit();
          });
      }
  });
  prettyPrint();
});
</script>
  <script>
  KindEditor.ready(function(K) {
      var editor = K.editor({
          fileManagerJson : '../zycheditor/asp/file_manager_json.asp'
      });
      K('#filemanager').click(function() {
          editor.loadPlugin('filemanager', function() {
              editor.plugin.filemanagerDialog({
                  viewType : 'VIEW',
                  dirName : 'image',
                  clickFn : function(img, title) {
                      K('#img').val(img);
                      editor.hideDialog();
                  }
              });
          });
      });
  });
</script>
<script language="javascript">
<!--
function CheckAll(){
 for (var i=0;i<eval(form.elements.length);i++){
  var e=form.elements[i];
  if (e.name!="allbox") e.checked=form.allbox.checked;
 }
}
-->
</script>

</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="30" background="images/bg_list.gif"><div  style="padding-left:10px; font-weight:bold; color:#FFFFFF">业务一级分类</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="stable">
<thead><tr>
<td width="8%" align="center" class="td">ID</td>
<td width="17%" height="25" align="center" class="td">分类名称</td>
<td width="10%" align="center" class="td">图 片</td>
<td width="15%" align="center" class="td">分类说明</td>
<td width="13%" align="center" class="td">所属分类</td>
<td width="16%" align="center" class="td">分类地址</td>
<td width="7%" align="center" class="td">排 序</td>
<td width="7%" align="center" class="td">修改</td>
<td width="7%" align="center" class="td">删除</td>
</tr></thead>
<%   
set rs=server.createobject("adodb.recordset")
exec="select * from projects_big order by px_id asc"
rs.open exec,conn,1,1
if rs.eof then
response.write ("<div style=""padding:10px;"">暂无一级分类!</div>")
else
rs.PageSize =300 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if   
for i=1 to rs.pagesize%>
<form action="?xiugai=projects_big" method="post" name="add">
<tr style="background: #F5F5F5">
<td width="8%" align="center" class="td"><%=rs("projects_bigID")%><input name="projects_bigID" type="hidden" size="15"  value="<%=rs("projects_bigID")%>"/></td>
<td width="17%" height="25" class="td"><input name="projects_bigName" type="text" size="15"  value="<%=rs("projects_bigName")%>"/></td>
<td width=""5%"" align="center" class="td"><input name="img" type="text" size="20"  value="<%=rs("img")%>"/></td>
<td width=""20%"" align="center" class="td"><input name="shuomin" type="text" size="20"  value="<%=rs("shuomin")%>"/></td>
<td width="13%" align="center" class="td">一级分类</td>
<td width="16%" class="td">/Service/?projects_bigID=<%=rs("projects_bigID")%></td>
<td width="7%" class="td"><input name="px_id" type="text" value="<%=rs("px_id")%>" size="4"  /></td>
<td width="7%" align="center" class="td"><input type="submit" name="button2" id="button2" value="修改"  class="btn"/></td>
<td width="7%" align="center" class="td"><input type="button" name="Submit" value="删除" onClick="javascript:if(confirm('确定删除?删除后不可恢复!')){window.location.href='admin_projects_fl.asp?act=del_projects_big&id=<%=rs("projects_bigID")%>';}else{history.go(0);}"  class="btn"/></td>
</tr></form>
<%set rs2=server.createobject("adodb.recordset")
exec="select * from [projects_small] where projects_bigID="&rs("projects_bigID")&" order by px_id asc  "
rs2.open exec,conn,1,1
if rs2.eof and rs2.bof then
response.Write("")
else
do while not rs2.eof%>
<form action="?xiugai=projects_small" method="post" name="add">
<tr>
<td width="8%" align="center" class="td"><input name="project_smallID" type="hidden" size="15"  value="<%=rs2("projects_smallID")%>"/></td>
<td width="17%" class="td" style="padding-left:20px">├─<%=rs2("px_id")%>.<input name="projects_smallName" type="text" size="15"  value="<%=rs2("projects_smallName")%>"/></td>
<td width="5%" class="td">&nbsp;</td>
<td width="20%" class="td">&nbsp;</td>

<td width="13%" align="center" class="td">├─<select name="projects_bigID" id="select">
<%
dim rsc
set rsc=server.CreateObject("adodb.recordset")
rsc.open "select * from projects_big",conn,1,1
while not rsc.eof
if rs2("projects_bigID")=rsc("projects_bigID") then
response.Write("<option value=""" & rsc("projects_bigID") & """ selected>" & rsc("projects_bigName") & "</option>")
else
response.Write("<option value=""" & rsc("projects_bigID") & """>" & rsc("projects_bigName") & "</option>")
end if
rsc.movenext
wend
rsc.close
set rsc=nothing
%>
</select>
</td>
<td width="16%" class="td">├─/Service/?projects_bigID=<%=rs("projects_bigID")%>&projects_smallID=<%=rs2("projects_smallID")%></td>
<td width="7%" class="td">├─<input name="px_id" type="text" value="<%=rs2("px_id")%>" size="2"  /></td>
<td width="7%" align="center" class="td"><input type="submit" name="button2" id="button2" value="修改"  class="btn"/></td>
<td width="7%" align="center" class="td"><input type="button" name="Submit" value="删除" onClick="javascript:if(confirm('确定删除?删除后不可恢复!')){window.location.href='admin_projects_fl.asp?act=del_projects_small&id=<%=rs2("projects_smallID")%>';}else{history.go(0);}"  class="btn"/></td>
</tr></form>
<%
rs2.movenext
loop
end if
rs2.close
set rs2=nothing

rs.movenext
if rs.eof then exit for
next
end if
%>
</table>
    </td>
  </tr>
</table>

<div style="margin-top:10px">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="?add=projects_big" method="post" name="add">
  <tr>
    <td height="30" background="images/bg_list.gif"><div  style="padding-left:10px; font-weight:bold; color:#FFFFFF">增加一级分类</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="stable" >
      <tr >
        <td width="18%" height="25" align="right" class="td">一级分类名称</td>
        <td width="82%"  class="td"><input name="projects_bigName" type="text" size="30"  /></td>
      </tr>
      
      <tr>
        <td width="18%" height="25" align="right" class="td">排序ID</td>
        <td class="td"><input name="px_id" type="text" size="30"  />
          数字越小越靠前。</td>
      </tr>
<tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
<td height="12" align="right" class="td"><font color="#FF0000">*</font>标题略缩图</td>
<td class="td"><table width="52%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%"><input type=text id="img" name=img size=50></td>
<td width="21%"><input type="button" class="btn2" id="filemanager" value="选取已上传图片" /></td>
<td width="58%"><iframe src="up.asp?formname=form1&inputname=img&uploadstyle=case" frameborder="0" scrolling="no" width="350" height="25"></iframe></td>
</tr>
</table>
</td>
</tr>
<tr>
<TD align=right height=30 class="td">上传图片图片</td>
<td colspan="3" class="td"><input name="ImagePath" type="hidden" id="ImagePath" value="<%=ImagePath%>" size="50">
<div id="pw"></div>
<script type="text/javascript">
//parent.parent.FCKeditorAPI.GetInstance('content')
// 设置编辑器中内容
function SetEditorContents(EditorName, ContentStr) {
var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
oEditor.Focus();
oEditor.InsertHtml("<img src="+"'"+ContentStr+"'"+"/>");   
}
function SetEditorPage(EditorName, ContentStr) {
var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
oEditor.Focus();
oEditor.InsertHtml(ContentStr);   
}
</script>
<script type="text/javascript">
function dropThisDiv(t,p)
{
document.getElementById(t).style.display='none'
var str =document.getElementById("ImagePath").value;
var arr = str.split("|");
var nstr="";
for (var i=0; i<arr.length; i++)
{
if(arr[i]!=p)
{
if (nstr!="")
{
  nstr=nstr+"|";
}        
nstr=nstr+arr[i]
}
}
document.getElementById("ImagePath").value=nstr;

doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))
}

function setimg(t)
{
document.getElementById("img").value=t

doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))
}

function doChange(objText, objDrop){
if (!objDrop) return;
var str = objText.value;
var arr = str.split("|");
var nIndex = objDrop.selectedIndex;
objDrop.length=1;
for (var i=0; i<arr.length; i++){
objDrop.options[objDrop.length] = new Option(arr[i], arr[i]);
}
objDrop.selectedIndex = nIndex;
}
doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))
</script>
<div></div></td>
</tr>
<tr >
        <td height="25" align="right" class="td"><font color="#FF0000">*</font>简单说明</td>
        <td class="td"><textarea name="shuomin" cols="50" rows="4"></textarea></td>
      </tr>     
      <tr>
        <td height="25" align="right" class="td">&nbsp;</td>
        <td class="td"><label>
        <input type="submit" name="button" id="button" value="增加分类"  class="btn"/>
        </label></td>
      </tr>
    </table></td>
  </tr></form>
</table>
    </div>   
<div style="margin-top:10px">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="?add=projects_small" method="post" name="add">
  <tr>
    <td height="30" background="images/bg_list.gif"><div  style="padding-left:10px; font-weight:bold; color:#FFFFFF">增加二级分类</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="stable" >
      <tr >
        <td width="18%" height="13" align="right" class="td">二级分类名称</td>
        <td width="82%"  class="td"><input name="projects_smallName" type="text" size="30"  /></td>
      </tr>
      <tr >
        <td width="18%" height="12" align="right" class="td">所属大类</td>
        <td  class="td"><select name="projects_bigID" id="select">
<%
dim rss
set rss=server.CreateObject("adodb.recordset")
rss.open "select * from projects_big",conn,1,1
while not rss.eof
response.Write("<option value=""" & rss("projects_bigID") & """>" & rss("projects_bigName") & "</option>")
rss.movenext
wend
rss.close
set rss=nothing
%></select></td>
      </tr>
      
      <tr>
        <td width="18%" height="25" align="right" class="td">排序ID</td>
        <td class="td"><input name="px_id" type="text" size="30"  />
          数字越小越靠前。</td>
      </tr>
      
      <tr>
        <td height="25" class="td">&nbsp;</td>
        <td class="td"><label>
        <input type="submit" name="button" id="button" value="增加分类"  class="btn"/>
        </label></td>
      </tr>
    </table></td>
  </tr></form>
</table>
<br><br><br>

</div>
</body>
</html>
<% '一级分类修改
if Request.QueryString("xiugai")="Projects_big" then
id=request("Projects_bigID")
sql="select * from projects_big where Projects_bigID="&id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字!""); history.go(-1);</script>")
response.end
end if
rs("BigClassName")=request.form("BigClassName")
rs("img")=request.form("img")
rs("shuomin")=request.form("shuomin")
rs("px_id")=request.form("px_id")
rs.update
rs.close
response.Write("<script language=""javascript"">alert(""当前分类修改成功!"");window.location.href='admin_products_bigclass.asp';</script>")
end if
'删除一级分类
if request("act")="del_projects_big" then
    id=request("id")
    if id="" then
    Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('admin_projects_fl.asp');</script>"
    Response.End()
    end if
set rs=server.createobject("adodb.recordset")
rs.open "Select * from projects_big where projects_bigID="&Request("id"),conn,1,3
if rs.bof and rs.eof then
    Response.Write "<script language='javascript'>alert('数据库中没有该记录!');document.location.href('admin_projects_fl.asp');</script>"
    Response.End()
else
    rs.Delete
    rs.Update
    Response.Write "<script language='javascript'>alert('当前分类删除成功!');document.location.href('admin_projects_fl.asp');</script>"
end if
end if
'新增一级分类
if request("add")="projects_big" then
set rs=server.createobject("adodb.recordset")
sql="select * from projects_big"
rs.open sql,conn,1,3
projects_bigName=request.form("projects_bigName")
img=request.form("img")
shuomin=request.form("shuomin")
px_id=request.form("px_id")
if projects_bigName=""  then
response.Write("<script language=javascript>alert('分类名称不能为空!');history.go(-1)</script>")
response.end
end if
if px_id=""  then
response.Write("<script language=javascript>alert('排序ID不能为空!');history.go(-1)</script>")
response.end
end if
IF not isNumeric(request("px_id"))  then
response.write("<script>alert("" 错误!排序ID必须为数字!""); history.go(-1);</script>")
response.end
end if
rs.addnew
rs("projects_bigName")=projects_bigName
rs("img")=img
rs("shuomin")=shuomin
rs("px_id")=px_id
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
Response.Write "<script>alert('一级分类增加成功!');window.location.href='admin_projects_fl.asp';</script>"
end if
%>

<% '二级分类修改
if Request.QueryString("xiugai")="Projects_small" then
id=request("Projects_smallID")
sql="select * from projects_smal where Projects_smallID="&id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字!""); history.go(-1);</script>")
response.end
end if
rs("Projects_smallName")=request.form("Projects_smallName")
rs("Projects_bigID")=request.form("Projects_bigID")
rs("px_id")=request.form("px_id")
rs.update
rs.close
response.Write("<script language=""javascript"">alert(""当前分类修改成功!"");window.location.href='admin_products_BigClass.asp';</script>")
end if
'删除二级分类
if request("act")="del_projects_small" then
    id=request("id")
    if id="" then
    Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('admin_projects_fl.asp');</script>"
    Response.End()
    end if
set rs=server.createobject("adodb.recordset")
rs.open "Select * from  projects_small where projects_smallID="&Request("id"),conn,1,3
if rs.bof and rs.eof then
    Response.Write "<script language='javascript'>alert('数据库中没有该记录!');document.location.href('admin_projects_fl.asp');</script>"
    Response.End()
else
    rs.Delete
    rs.Update
    Response.Write "<script language='javascript'>alert('当前分类删除成功!');document.location.href('admin_projects_fl.asp');</script>"
end if
end if
'新增二级分类
if request("add")="projects_small" then
set rs=server.createobject("adodb.recordset")
sql="select * from projects_small"
rs.open sql,conn,1,3
projects_smallName=request.form("projects_smallName")
projects_bigID=request.form("projects_bigID")
px_id=request.form("px_id")
if projects_smallName=""  then
response.Write("<script language=javascript>alert('二级分类名称不能为空!');history.go(-1)</script>")
response.end
end if
if px_id=""  then
response.Write("<script language=javascript>alert('排序ID不能为空!');history.go(-1)</script>")
response.end
end if
IF not isNumeric(request("px_id"))  then
response.write("<script>alert("" 错误!排序ID必须为数字!""); history.go(-1);</script>")
response.end
end if
rs.addnew
rs("projects_smallName")=projects_smallName
rs("projects_bigID")=projects_bigID
rs("px_id")=px_id
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
Response.Write "<script>alert('二级分类增加成功!');window.location.href='admin_projects_fl.asp';</script>"
end if
%>
搜索更多相关主题的帖子: content include PUBLIC title 网页 
2015-09-11 11:43
林月儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:湖南
等 级:版主
威 望:138
帖 子:2277
专家分:10647
注 册:2015-3-19
收藏
得分:7 
这是一页代码?

剑栈风樯各苦辛,别时冰雪到时春
2015-09-11 12:38
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:7 
那你应该重点检查与修改相关的代码。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-09-11 17:21
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:0 
可以增加、删除,说明数据库连接没有问题,可以根据系统提示信息重点检查与修改相关的代码。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-09-11 17:24
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:7 
response.end 一行一行调试。


rs.open"  ",conn,1,1 这样是更新不了的。

ASP讨论QQ群:251346273
2015-09-17 10:41
快速回复:请教大神帮助,网页可以增加,删除,就是不能修改,不知道那儿错了,请 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.064680 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved