輸入一些代碼後,我開始遇到錯誤之前,此網站正常工作。該代碼不在主頁上,但現在沒有任何網站頁面會加載。我在IIS中重新啓動了該站點,但沒有任何幫助。在單個頁面上輸入一些代碼後,將無法加載經典ASP網站中的頁面
這裏是我輸入的代碼:
'Prepare to parse XML
Set objXML = Server.CreateObject(Microsoft.XMLDOM)
'Set Asynchoronous = false
objXML.async = False
'Load the XML file.
'User Server.MapPath method is the XML is located in your site.
'Else you can use the absolute path.
objXML.Load (Server.MapPath(Products.xml))
'If there is any errors pasring the file the notify
If objXML.parseError.errorCode = 0 Then
'Response.Write(objXML.parseError.reason)
Else objXML.parseError.errorCode <> 0 Then
'Get ALL the Elements by the tag name product
Set products = objXML.getElementsByTagName(product)
Select Case iItemID
Case 1
aParameters = Array(products.item(0).childNodes(0).text, products.item(i).childNodes(2).text, products.item(i).childNodes(2).text)
Case 2
aParameters = Array(products.item(1).childNodes(0).text, products.item(i).childNodes(2).text, products.item(i).childNodes(2).text)
End Select
' Return array containing product info.
GetItemParameters = aParameters
End If
使用傳統的ASP在Windows 7中運行IIS。用Notepad ++編輯。
下面是XML文件:
<configuration>
<products>
<product>
<image>
<![CDATA[ /Images/Atlas Gloves.jpg ]]>
</image>
<name>
<![CDATA[ Atlas Nitrile Touch Gloves ]]>
</name>
<description>
<![CDATA[ Atlas Nitrile Touch is available in 6 vibrant colors, and is America’s #1 glove for the Lawn and Garden market. Atlas gloves have a breathable nylon back and are machine washable. Like a 「second skin,」 these gloves are the most comfortable! Atlas Nitrile gloves are the #1 gardening gloves. Atlas Nitrile gloves act like a "second skin" between the user and their work, offering full dexterity and grip. Atlas Nitrile Gloves are perfect for gardening, but their uses expand to so many places – the woodshop, the workshop, the workplace. ]]>
</description>
<size>
<![CDATA[ Small, Medium ]]>
</size>
<color>
<![CDATA[ Purple, Pink, Green, Orange ]]>
</color>
</product>
</products>
</configuration>
實際的錯誤消息將有所幫助。 – 2012-02-15 21:55:35
我沒有收到錯誤消息。它從來沒有加載。 – Darren 2012-02-15 21:56:12
看看你的服務器日誌。 – 2012-02-15 21:56:53