Help with ASP.NET - DOTNET
This is a discussion on Help with ASP.NET - DOTNET ; Hey, I'm a beginner with the ASP.NET language. I'm reading an ASP.NET book
that has an example, but when i copied the code from the book it didn't
work.
Here's the sample code:
<%@ Page Language=" VB " Debug="True" %>
...
-
Help with ASP.NET
Hey, I'm a beginner with the ASP.NET language. I'm reading an ASP.NET book
that has an example, but when i copied the code from the book it didn't
work.
Here's the sample code:
<%@ Page Language="VB" Debug="True" %>
<html>
<head>
<title>Hello and Welcome Page</title>
</head>
<body>
<center>
<% Dim TextSize As Integer %>
<% For TextSize = 1 To 7 %>
<font size = <%=TextSize%>>
Hello and Welcome!<br>
</font>
<% Next %>
</center>
</body>
</html>
It's suppose to show "Hello and Welcome" 7 times in accordance with the font
size. I ran the code through Macromedia and in Webmatrix and all the page
displays is one line saying "Hello and Welcome".
Can somebody tell me if the code is wrong or is it something I am doing?
Thanks
Shawn
-
Re: Help with ASP.NET
Not sure, but I think that in order to run this in Web Matrix, you have to
use the code-behind method. That means that your VB code needs to be
separate from the html code and not all mixed together like you have it.
The book thta you are using is probably for using ASP.NET within Visual
Studio, but if you are using Web Matrix, the code may need to be modified. I
would recommend that you get one of the books specifically for using Web
Matrix.
"Shawn Marshall" <marsha41@email.pct.edu> wrote in message
news:u%232vOA0xDHA.1616@TK2MSFTNGP11.phx.gbl...
> Hey, I'm a beginner with the ASP.NET language. I'm reading an ASP.NET
book
> that has an example, but when i copied the code from the book it didn't
> work.
>
> Here's the sample code:
>
> <%@ Page Language="VB" Debug="True" %>
> <html>
> <head>
> <title>Hello and Welcome Page</title>
> </head>
> <body>
> <center>
> <% Dim TextSize As Integer %>
> <% For TextSize = 1 To 7 %>
> <font size = <%=TextSize%>>
> Hello and Welcome!<br>
> </font>
> <% Next %>
> </center>
> </body>
> </html>
>
> It's suppose to show "Hello and Welcome" 7 times in accordance with the
font
> size. I ran the code through Macromedia and in Webmatrix and all the page
> displays is one line saying "Hello and Welcome".
>
> Can somebody tell me if the code is wrong or is it something I am doing?
>
> Thanks
> Shawn
>
>