⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modifysubcatalog.asp

📁 Windows Web脚本开发指南/(美) Dan Heflin, Todd Ney著 的源码
💻 ASP
字号:
<%@ LANGUAGE=JavaScript %>
<html>
<script Language="JavaScript">

function loadSubCatalog(){
  subCatalog.async = false;
  subCatalog.load("<% =Request.QueryString("catFile") %>");
  editCatalog.async = false;
  editCatalog.loadXML(subCatalog.documentElement.firstChild.xml);
  editCatalog.recordset.MoveFirst();
}
function navigate(direction){
  switch(direction){
    case "next":
      editCatalog.recordset.MoveNext();
      tblList.nextPage();
      break;
    case "last":
      editCatalog.recordset.MoveLast();
      tblList.lastPage();
      break;

    case "previous":
      editCatalog.recordset.MovePrevious();
      tblList.previousPage();
      break;

    case "first":
      editCatalog.recordset.MoveFirst();
      tblList.firstPage();
      break;
  }
}
function addItem(){
  editCatalog.recordset.addNew();
  editCatalog.recordset.MoveLast();  
  tblList.lastPage();
}
function deleteItem(){
  editCatalog.recordset.Delete();
  editCatalog.recordset.MoveFirst();
  tblList.firstPage();
}
function sendData(){
  document.all.xmlSource.value = "<subcatalog>" + editCatalog.xml + "</subcatalog>";
  sendXML.submit();
}
</script>
<xml ID="subCatalog"></xml>
<xml ID="editCatalog"></xml>
<head>
<title>Product Catalog</title>
</head>
<body onLoad="loadSubCatalog()">
  <p align="center"><font size="5">Product Listing - <% =Request.QueryString("catDesc") %></font></p>
  <table id="tblList" DATASRC="#editCatalog"  border="1" align="center" DATAPAGESIZE="1">
    <tr>
      <td>Item #:</td> 
      <td><input type="text" DATAFLD="id"></td>
    </tr>
    <tr>
      <td>Short Description:</td>
      <td><input type="text" DATAFLD="shortDesc" size="55"></td>
    </tr>
    <tr>
      <td>Price:</td>
      <td><input type="text" DATAFLD="price"></td>
    </tr>
    <tr>
      <td>Long Description:</td>
      <td><textarea rows="6" cols="50" DATAFLD="longDesc"></textarea></td>
    </tr>
    <tr>
      <td>Image Path:</td>
      <td><input type="text" size="55" DATAFLD="imagePath"></td>
    </tr>
  </table>
 </table> 
<p align="center">
<input type="button" value="<<" onClick="navigate('first')"><input type="button" value="<" onClick="navigate('previous')">
<input type="button" value=">" onClick="navigate('next')"><input type="button" value=">>" onClick="navigate('last')">
</p>
<p align="center">
<input type="button" value="Add" onClick="addItem()"><input type="button" value="Delete" onClick="deleteItem()">
<input type="button" value="Save" onClick="sendData()">
<br><br><a href="hier.htm">Return To Menu</a>
</p>
<form id="sendXML" method="post" action="saveSubCatalog.asp?fileName=<% =Request.QueryString("catFile") %>">
<input type="hidden"  name="xmlSource">
</form>
</body>
<html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -