T
Thomas Scheiderich
In one of my ASP.NET books, it states that one of the differences
between ASP.NET and classic ASP, is that in classic you can have script
code anywhere in your html page. But that in ASP.NET, it must precede
the Body of the page.
I have one here called rolldice.aspx which works fine with the script
code before or after the <body> tag.
******************************************************
<HTML>
<HEAD>
<TITLE>Roll Dice</TITLE>
</HEAD>
<BODY>
<script runat="server">
function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(rnd * 6) + 1
Return(roll)
end function
</script>
<p>I'll roll two dice; let's see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
<p>First roll: <%=firstroll%><br>
<p>Second roll: <%=secondroll%><br>
</body>
</html>
************************************************************
Why is this? Did I miss read the statement?
Thanks,
Tom.
between ASP.NET and classic ASP, is that in classic you can have script
code anywhere in your html page. But that in ASP.NET, it must precede
the Body of the page.
I have one here called rolldice.aspx which works fine with the script
code before or after the <body> tag.
******************************************************
<HTML>
<HEAD>
<TITLE>Roll Dice</TITLE>
</HEAD>
<BODY>
<script runat="server">
function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(rnd * 6) + 1
Return(roll)
end function
</script>
<p>I'll roll two dice; let's see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
<p>First roll: <%=firstroll%><br>
<p>Second roll: <%=secondroll%><br>
</body>
</html>
************************************************************
Why is this? Did I miss read the statement?
Thanks,
Tom.