Reputation: 31
I have an ASP page called map.asp and in it I have a dynamically generated table with links to detailed node and utilization information. However, I need to pass this information to a frameset. It currently is code like this:
<a href='gauge-frame.asp?nodeid=<%response.write rsnetdevices("nodeid")%>'
where gauge-frame.asp looks like this:
<frame src="details.asp?nodeid=<%response.write rsnetdevices("nodeid")%>">
However, I'm getting a "Page cannot be displayed error".
Suggestions on how to fix are appreciated.
Dale
============================
Below is maptest.asp
<%
Option Explicit
Dim rsSolarWinds, conn, rsnetdevices, nodeid
nodeid = Request.QueryString("nodeid")
set Conn=Server.CreateObject("ADODB.Connection")
set rsSolarWinds = server.CreateObject("ADODB.Recordset")
Conn.open "Provider=sqloledb;Server="";Initial Catalog=Skynet;
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%') " )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<table class="gradienttable" cellspacing="0" border>
<tr>
<th colspan=4 style="font-size:7.5pt"; "font:small Verdana,Sans-serif";"font-family:Verdana" align="center">Network Devices</th>
</tr>
<tr>
<th style="font-size:7.5pt"; "font:small Verdana,Sans-serif";"font-family:Verdana" align="center">Node ID</th>
<th style="font-size:7.5pt"; "font:small Verdana,Sans-serif";"font-family:Verdana" align="center">Node Name</th>
<th style="font-size:7.5pt"; "font:small Verdana,Sans-serif";"font-family:Verdana" align="center">Node Status</th>
</tr>
<%do while not rsnetdevices.EOF%></do>
<tr>
<td width=8 style="font-size:7.5pt"; "font:small Verdana,Sans-serif";"font-family:Verdana" align="center">
<a href='gauge-frame.asp?nodeid=<%response.write rsnetdevices("nodeid")%>' target="_blank" title="Show Node Details")><%response.write rsnetdevices("nodeid")%></a>
</td>
<%rsnetdevices.MoveNext%>
<%loop%>
</tr>
</table>
</body>
</html>
And below is 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>
Upvotes: 1
Views: 310
Reputation: 31
@SearchAndResQ was correct in that nodeid was missing in the select statement.
Upvotes: 1
Reputation: 3854
I see an extra closing parenthesis at the end of the SQL in this section:
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%') " )
As ullfindsmit commented, you need to disable the "Show Friendly Messages" misfeature in IIS, so it'll give you the actual line number and error message, not the totally useless and infuriating "page couldn't be displayed" message.
Upvotes: 0