尝试在远程服务器上运行此代码时出错。 我每次尝试运行此代码时都会收到此错误。
我甚至无法弄清楚这个文件中的内容和错误,这个远程服务器并没有向我显示任何错误。 http://labwebs.webster.edu/gmakharadze78/coap2100/fig23-13.aspx
<%@ Page Language="JScript" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- Web.Config Configuration File -->
<!-- Fig. 23.13: adRotator.aspx -->
<!-- ASP.NET AdRotator example -->
<html>
<head>
<title>Ice Creams</title>
<script language = "JScript" runat = "server">
function submitButton_Click(
sender : Object, events : EventArgs ) : void
{
if ( IsPostBack )
{
if ( iceCream.SelectedItem == "Yes" )
{
message.Text = name.Text + " likes ice cream.";
}
else
{
message.Text = name.Text + " does not like ice cream.";
}
}
} // end submitButton_Click
</script>
</head>
<body>
<form action = "adRotator.aspx" method = "post" runat = "server">
<asp:AdRotator AdvertisementFile = "ads.xml"
BorderColor = "black" BorderWidth = "1" runat = "server"/>
<table>
<tr>
<td>
Name: <asp:TextBox id = "name" runat = "server"/>
</td>
<td>
<asp:RequiredFieldValidator id = "requiredCheck"
ControlToValidate = "name"
Display = "Static"
runat = "server">
Please enter your name.
</asp:RequiredFieldValidator>
</td>
</tr>
</table>
<br />
Do you like ice cream?
<asp:RadioButtonList id = "iceCream" runat = "server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:RadioButtonList>
<br />
How many scoops would you like? (0-5)
<asp:TextBox id = "scoops" runat = "server" />
<br />
<asp:button text = "Submit" OnClick = "submitButton_Click"
runat = "server"/>
<asp:RangeValidator id = "rangeCheck"
ControlToValidate = "scoops"
MinimumValue = "0"
MaximumValue = "5"
Type = "Integer"
EnableClientScript = "false"
Text = "We cannot give you that many scoops."
runat = "server" />
<center>
<h1> <asp:label id = "message" runat = "server"/> </h1>
</center>
</form>
</body>
</html>
<!--
**************************************************************************
* (C) Copyright 1992-2004 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
**************************************************************************
-->
此应用程序的.xml文件。
<?xml version = "1.0"?>
<!-- Fig. 23.14: ads.xml -->
<!-- Flag database -->
<IceCreams>
<IceCream>
<ImageUrl>img/Chocolate.png</ImageUrl>
<ImageUrl>img/Mix.png</ImageUrl>
<NavigateUrl>http://www.foodnetwork.com/recipes/alton-brown/chocolate-ice-cream-recipe.html</NavigateUrl>
<AlternateText>Chocolate IceCream</AlternateText>
</IceCream>
<IceCream>
<ImageUrl>img/Strawbery.png</ImageUrl>
<ImageUrl>img/Ice.png</ImageUrl>
<NavigateUrl>http://www.foodnetwork.com/recipes/jamie-deen/strawberry-and-cream-ice-cream-recipe.html</NavigateUrl>
<AlternateText>Strawbery IceCream</AlternateText>
</IceCream>
<IceCream>
<ImageUrl>img/Vanilla.jpeg</ImageUrl>
<ImageUrl>img/All.jpg</ImageUrl>
<NavigateUrl>http://www.foodnetwork.com/recipes/alton-brown/vanilla-ice-cream-recipe.html</NavigateUrl>
<AlternateText>Vanilla IceCream</AlternateText>
</IceCream>
</IceCreams>
<!--
**************************************************************************
* (C) Copyright 1992-2004 by Deitel & Associates, Inc. and *
* Pearson Education, Inc. All Rights Reserved. *
* *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development, research, and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind, expressed or implied, with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with, or arising out of, the *
* furnishing, performance, or use of these programs. *
**************************************************************************
-->