can some one point out the error in this code

I typed this from a book I'm using to learn ASP.net, but when I run it, it shows the typed code and not the page.  If I copy the code from the CD and compare it, it is exactly the same, but the copied version runs.

gary

<%@ Page Language="VB" %>
<!Doctype html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Sub Button_Click(ByVal sender as Object, ByVal e as EventArgs)
    Dim btn as Button = CType(sender, Button)
    btn.Text = (int32Parse(btn.Text) + 1.ToString()
    end Sub
</script>
<html xmlns=http://www.w3.org/1999/xhtml"  >
<head id="Head1"  runat="server" >
<title>Button Counters</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    First Counter:
    <asp:Button
        id="Button1"
        Text="0"
        OnClick="Button_Click"
        Runat="server" />
<br /> <br />
Second Counter:
<asp:Button
        id="Button2"
Text="0"
        OnClick="Button_Click"
        Runat="server" />
</div>
</form>
</body>
</html>
javagairAsked:
Who is Participating?
 
GaryCommented:
What are you running this through - Visual Studio?
0
 
GaryCommented:
Are you actually running this through your server
I assume this is on your local pc so you should be using something like

http://localhost/yourpage.aspx
0
 
javagairAuthor Commented:
0
 
javagairAuthor Commented:
visual studio problem
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.