- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请你能给我推荐一个经典的asp和ajax例子来制作依赖组合吗?
最佳答案
早在 AJAX 的概念正式化之前,我就使用了一种名为 XML Data Islands 的技术。来实现这种功能。显然,有许多 AJAX 框架和脚本可以实现类似的结果,但这只是我多年来在遗留应用程序中使用的久经考验的技术。
没办法快速找到合适的文章,所以挖了一些我的旧代码。基本上,当您设置父控件的值时,您会运行一些将请求发送到单独 ASP 页面的 javascript。此页面查询 DB 以确定将用于填充子控件的数据。
第二个页面以 XML 形式返回结果,该结果在主页面的 XML 数据岛中存储和操作。然后调用 javascript 解析返回的 XML 并填充子控件。
首先,我们有来自主控件的 javascript 调用:
<tr>
<td>Customer:</td>
<td>
<select id="CustomerID" NAME="CustomerID"
onfocus="javascript:populateCombo(fProcess.CustomerID.value)"
onChange="javascript:populateCombo(fProcess.CustomerID.value)"
onkeypress="javascript:populateCombo(fProcess.CustomerID.value);">
</select>
</td>
</tr>
<tr>
<td>Depot:</td>
<td>
<select name="depot" id="depot" size="1" alt="Depot">
<option value="" selected ><Select Depot></option>
</select>
</td>
</tr>
// Fill combo with XML data
function populateCombo(par) {
var currNode;
XMLID.async = false;
// Change Data Island source
strQuery = "Select LocationID, LocationName from Locations where CustomerID='" + par + "' and Active = 1 Order By LocationName";
XMLID.SRC="/fxdb/common/xmlQuery.asp?strQuery=" + strQuery;
// Get all "names" from XML data
objNodeList = XMLID.getElementsByTagName("LocationName");
objNodeListID= XMLID.getElementsByTagName("LocationID");
// Fill combo with names
for (var i=0; i < objNodeList.length; i++) {
fProcess.depot.options[i]=new Option(objNodeList.item(i).text,objNodeListID.item(i).text);
}
// Delete extra entries
while ( objNodeList.length < fProcess.depot.options.length) {
fProcess.depot.options[(fProcess.depot.options.length - 1)] = null;
}
}
<%@ Language="VBScript" %>
<%
' Declare all variables.
Option Explicit
Dim strSql,objRS,objField
Dim sConn, oConn
Dim strName, strValue
' Buffer and output as XML.
Response.Buffer = True
Response.ContentType = "text/xml"
' Start our XML document.
Response.Write "<?xml version=""1.0""?>" & vbCrLf
' Set SQL and database connection string.
set oConn=server.createobject("adodb.connection")
sConn=Application("Connection")
oConn.Open sConn
strSQL = Request.QueryString("strQuery")
set objRS=oConn.execute(strSQL)
' Output start of data.
Response.Write "<database>" & vbCrLf
' Loop through the data records.
While Not objRS.EOF
' Output start of record.
Response.Write "<record>" & vbCrLf
' Loop through the fields in each record.
For Each objField in objRS.Fields
strName = objField.Name
strValue = objField.Value
If Len(strName) > 0 Then strName = Server.HTMLEncode(strName)
If Len(strValue) > 0 Then strValue = Server.HTMLEncode(strValue)
Response.Write "<" & strName & ">" & vbCrLf
Response.Write strValue & vbCrLf
Response.Write "</" & strName & ">" & vbCrLf
Next
' Move to next city in database.
Response.Write "</record>" & vbCrLf
objRS.MoveNext
Wend
' Output end of data.
Response.Write "</database>" & vbCrLf
%>
<!-- Data Island-->
<XML ID="XMLID"></XML>
关于ajax - 经典 ASP 和 Ajax 中的依赖组合?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1629569/
本文实例总结了常用SQL语句优化技巧。分享给大家供大家参考,具体如下: 除了建立索引之外,保持良好的SQL语句编写习惯将会降低SQL性能问题发生。 ①通过变量的方式来设置参数 好:
写CSS的同学们往往会体会到,随着项目规模的增加,项目中的CSS代码也会越来越多,如果没有及时对CSS代码进行维护,CSS代码不断会越来越多。CSS代码交错复杂,像一张庞大的蜘蛛网分布在网站的各个位
所以我必须解决类的背包问题。到目前为止,我想出了以下内容。我的比较器是确定两个主题中哪一个是更好选择的函数(通过查看相应的(值,工作)元组)。 我决定迭代工作量小于 maxWork 的可能主题,并且为
前言:复杂类型说明 要了解指针,多多少少会出现一些比较复杂的类型,所以我先介绍一下如何完全理解一个复杂类型,要理解复杂类型其实很简单,一个类型里会出现很多运算符,他们也像普通的表达式一样,有优先级
代码如下: 复制代码代码如下: USE [tempdb] GO /****** Object: UserDefinedFunction [dbo].[fun
最近收到一个工作要求,让我完成一个每天一次的Linux服务器巡检工作(服务器的版本为红帽6.4),不可以使用监控软件来操作。在这里,把我的巡检过程和巡检脚本放送给大家做一参考。 首先,巡检内容
可以在 Classic ASP 中动态创建“空”对象并创建对象属性吗? 以这个 JavaScript 示例为例: var sample = new Object(); sample.prop = "O
我正在向旧的经典 asp 站点添加功能,但遇到了一个有趣的问题。页面上的以下行导致有用的错误“需要对象:''” strServerName = Request.ServerVariables("ser
我有一个经典的 ASP 应用程序,我正在处理日期截止。我的服务器位于中部时间,但我在东部时间。发生的情况是我的应用程序认为它早了一个小时,而我的截止时间晚了一个小时。我敢肯定,如果用户在太平洋时间,他
我是经典 ASP 的初学者。需要拆分一个由逗号分隔的许多电子邮件组成的字符串,并使用稍后生成的附加代码将结果插入(逐个电子邮件)到表格中。每条记录都应该有一个电子邮件地址。问题是我陷入了数组范围错误。
这个问题已经有答案了: one condition, multiple events (2 个回答) 已关闭 6 年前。 如何用更小的语句替换 1,2,3..。我尝试将 1 放入 10,但显示错误。
我是 ExtJS 的新手,所以我不知道是否可能。 Google 只回答如何为图表制作工具提示,所以... 我需要制作一个带有工具提示的网格,当用户将鼠标放在单元格上时将显示该工具提示。在该工具提示中,
我正在使用一个非常奇怪的 VB 版本...它不需要我告诉它什么是什么,它想自己弄清楚。 在 C# 中,我可以轻松地对数组进行硬编码...在 VB 中则不然。 我想在调用函数时创建一个硬编码数组...但
我的数据库访问代码如下: set recordset = Server.CReateObject("ADODB.Recordset") set cmd1 = Server.CreateObject(
我有 html 按钮和文本框的代码:文本框是我输入文本的地方,以便我可以在表格上进行一些更改。 'textbox " /> 'button Clear 我现在需要做的是单击“清除”按
我有一个表单,提交后会通过电子邮件发送。该表单使用 JavaScript 进行验证。经典 ASP 处理表单,即获取输入的数据、创建然后发送电子邮件。有报道称正在提交空白表格。仅发送标题和 Logo 。
加载页面 A.asp 默认情况下正在执行,从那里开始执行电子邮件的情况,如果是电子邮件,我们将调用页面 B。我想在控件被执行时执行相同的电子邮件情况从页面 B 转移到页面 A。请帮助我。 Page A
我正在使用经典 ASP 开发一个项目,例如,我想添加一些用户作为临时列表,当我提交表单时,这些数据将保存到数据库中。 我知道如何在 asp.net 中使用它,但不知道如何在经典 asp 中使用它。 例
我有一个带有简单 html 表的经典 ASP 页面,我想根据从数据库中提取的未知数量的记录循环表行,但是,当我使用 do/while 循环循环记录时,我收到一条错误消息,指出 Either BOF o
嘿,一直在寻找一段时间,但我似乎找不到任何有关如何在经典 asp 中处理日期的信息。 现在,我需要一种方法来计算今年过去的天数。我正在考虑一个简单的函数,它将获取当前日期,然后使用 (day = 1,
我是一名优秀的程序员,十分优秀!