📄 browse.asp
字号:
<!--#include file="Include/ADOdata.asp" -->
<%
Response.Write RenderCatalog(Request.QueryString("CategoryID"))
Function RenderCatalog(intCategory)
'Function to retrieve products in a specified catalog.
Dim ConDB
Dim cmdProducts
Dim strmResult
'Connect to database
Set conDB = CreateObject("ADODB.Connection")
conDB.Open strCon
Set cmdProducts = CreateObject("ADODB.Command")
Set cmdProducts.ActiveConnection = conDB
'Use the ProductSchema.xml annotated schema
cmdProducts.Dialect = "{ec2a4293-e898-11d2-b1b7-00c04f680c56}" 'XPath Dialect
cmdProducts.Properties("mapping schema") = Server.MapPath("AppFiles\CatalogSchema.xml")
cmdProducts.CommandText = "Catalog/Category/Product[../@CategoryID=" & intCategory & "]" 'XPath for category
'Specify output stream for results
Set strmResult = CreateObject("ADODB.Stream")
strmResult.Open
cmdProducts.Properties("Output Stream") = strmResult
'Specify the root element for the returned document
cmdProducts.Properties("XML Root") = "CatalogData"
'Specify the XSL to be used
cmdProducts.Properties("XSL") = Server.MapPath("AppFiles\Products.xsl")
cmdProducts.Execute , , adExecuteStream
RenderCatalog = strmResult.ReadText
Set strmResult = Nothing
Set cmdProducts = Nothing
Set conDB = Nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -