Vbscript 如何使用ASP将参数传递到框架集
我有一个名为map.ASP的ASP页面,其中有一个动态生成的表,其中包含指向详细节点和利用率信息的链接。但是,我需要将此信息传递给框架集。目前的代码如下所示:Vbscript 如何使用ASP将参数传递到框架集,vbscript,asp-classic,Vbscript,Asp Classic,我有一个名为map.ASP的ASP页面,其中有一个动态生成的表,其中包含指向详细节点和利用率信息的链接。但是,我需要将此信息传递给框架集。目前的代码如下所示: <a href='gauge-frame.asp?nodeid=<%response.write rsnetdevices("nodeid")%>' <frame src="details.asp?nodeid=<%response.write rsnetdevices("nodeid")%>">
<a href='gauge-frame.asp?nodeid=<%response.write rsnetdevices("nodeid")%>'
<frame src="details.asp?nodeid=<%response.write rsnetdevices("nodeid")%>">
下面是frame-gauge.asp
<%
Option Explicit
Dim rsnetdevices, conn, nodeid
nodeid = Request.QueryString("nodeid")
set Conn=Server.CreateObject("ADODB.Connection")
set rsnetdevices = server.CreateObject("ADODB.Recordset")
Conn.open "Provider=sqloledb;Server="";Initial Catalog=Skynet;"
set rsnetdevices = conn.Execute ("SELECT description, sysname, machinetype, type, devicerole, cpuload, substring(statusdescription, 16,4) as nodedown, substring(statusdescription, 16,2) as nodeup, " _
& " ip_address, dns, nextpoll, location, unmanaged, percentmemoryused, contact, lastboot, iosversion, cpucount, substring(description, 77, 53) as software " _
& " FROM Nodes " _
& " where Nodes.Nodeid = '" &nodeid & "' " )
%>
<html>
<head>
<Title>Network Device Information</title>
<frameset cols="48%,52%" frameborder="0">
<frame src="gauges.asp" scrolling="NO" marginheight=0 marginwidth=0 >
<frame src="details.asp?nodeid=<%response.write rsnetdevices("nodeid")%>">
</frameset>
</head>
</html>
网络设备信息
我在本节的SQL结尾处看到了一个额外的右括号:
set rsnetdevices = conn.Execute ("SELECT Caption AS NodeName, nodeid, category, substring(statusdescription, 16,4) as nodedown " _
& " from nodes " _
& " where category = 'Infrastructure' or caption like '%intswt%' or caption like '%intrtr%') " )
正如ullfindsmit评论的那样,您需要禁用IIS中的“显示友好消息”错误功能,这样它将为您提供实际的行号和错误消息,而不是完全无用且令人恼火的“无法显示页面”消息。我在本节的SQL末尾看到了一个额外的右括号:
set rsnetdevices = conn.Execute ("SELECT Caption AS NodeName, nodeid, category, substring(statusdescription, 16,4) as nodedown " _
& " from nodes " _
& " where category = 'Infrastructure' or caption like '%intswt%' or caption like '%intrtr%') " )
正如ullfindsmit评论的那样,您需要禁用IIS中的“显示友好消息”错误功能,这样它将为您提供实际的行号和错误消息,而不是完全无用和恼人的“无法显示页面”消息。@SearchAndResQ在select语句中缺少nodeid是正确的。@SearchAndResQ在select语句中缺少nodeid是正确的。查看。可能是您必须以不同的方式引用变量,如
src=“details.asp?nodeid=“
或其他什么。我建议将所有href
和src
引用分别更改为#
或空白&将您试图访问页面的变量写入
中,以确保在href
或src
中引用之前获得输出。我认为您不需要使用响应。编写。如果您能够为前端和后端提供相关的完整代码,这可能会帮助我决定您需要使用哪种参考格式,即@AlexanderNied此代码是ASP Classic,而不是ASP.NET。他们非常不同。我已经修改了你添加的标签。@ADyson-谢谢,很抱歉-我应该等一个对ASP有更多了解的人来处理这个问题。我的错,谢谢你修复。我尝试添加ASP经典标记,但我没有足够的“点数”。请查看。可能是您必须以不同的方式引用变量,如src=“details.asp?nodeid=“
或其他什么。我建议将所有href
和src
引用分别更改为#
或空白&将您试图访问页面的变量写入
中,以确保在href
或src
中引用之前获得输出。我认为您不需要使用响应。编写。如果您能够为前端和后端提供相关的完整代码,这可能会帮助我决定您需要使用哪种参考格式,即@AlexanderNied此代码是ASP Classic,而不是ASP.NET。他们非常不同。我已经修改了你添加的标签。@ADyson-谢谢,很抱歉-我应该等一个对ASP有更多了解的人来处理这个问题。我的错,谢谢你修复。我尝试添加ASP经典标记,但我没有足够的“分数”。