I have a page being build using raw XML data and XSL. In the XSL I have a form that is posting to "index.asp", with info for the selection that was chosen via a button. All this is working correctly: the grid displays with the correct information, and it does post to the index.asp page. However, when I try to Request.Form in the index.asp page after pushing one of the buttons, it comes back with nothing. I can request.querystring and it comes back with the correct info, but I do not want to use querystrings. Any thoughts on what I'm doing wrong?
index.asp page
xsl file
index.asp page
Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Write("QueryString = " & Request.Querystring)
Response.Write "<br>"
Response.Write("Form = " & Request.Form)
Dim xmlDoc
xmlFile = Server.MapPath("testsubnode.xml")
xslFile = Server.MapPath("testhierarchy.xsl")
Set xml = Server.CreateObject("Microsoft.XMLDOM")
Set xsl = Server.CreateObject("Microsoft.XMLDOM")
xml.async=false
xml.Load(xmlFile)
xsl.async=false
xsl.load(xslFile)
Response.Write(xml.transformNode(xsl))
%>
Code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<script language="javascript">
function drillDown(n)
{
var f = document.getElementById("f1");
var s = document.getElementById("selectedAreaId");
s.value=n;
f.action="index.asp?nid="+n;
f.submit();
}
</script>
</head>
<body>
<h2>Select an Area</h2>
<form id="f1" method="post" action="index.asp">
<table border="0">
<tr bgcolor="#9acd32">
<th align="left">Area Id</th>
<th align="left">Title</th>
<th></th>
</tr>
<xsl:for-each select="Area/NodeData">
<tr bgcolor="#55aaaa">
<td><xsl:value-of select="AreaId"/></td>
<td><xsl:value-of select="Title"/></td>
<xsl:choose>
<xsl:when test="ChildCount > 0">
<td><input id="btnDrill" type="button" value="Drill Down" onClick="drillDown({./NodeId});"/></td>
</xsl:when>
<xsl:otherwise>
<td></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
<input type="hidden" id="selectedAreaId" value="0"/>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>