Thursday, March 22, 2012

why the ASP code gets ignored

I am just starting with .Net but it seems i am missing something.

I tried to copy-paste some simple Hello world examples in the HTML view of the .aspx file in Visual studio but all the asp code in between <% %> gets ignored.

For example:

<%@dotnet.itags.org. Page Language="VB"%><html><body><% Dim I As Integer For I = 0 To 7%><font size="<%=I%>"> Hello World!</font><br><% Next%></body></html>
I got just:
Hello World!
Instead of:
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
I suppose it is just some configuration that i haven't done but I just don't have any idea what it could be.
I will be really gladful for any help since i spent quite some time already trying to figure it out myself unsuccessfully.Sad [:(]

Change it to this:

<%@. Page Language="VB" %>

<html>

<body>

<% Dim I As Integer
For I = 0 To 7Step 1 %>
<font size="<%=I%>"> Hello World!</font><br>
<% Next%>

</body>

</html>

HTH,
Ryan


"Step 1" is already implied by default if that isn't there

On another note, that's not really ".NET sytle" as its more scripting style (Classic ASP).... not sure where you are going with practice coding like that, but it's sending you down the wrong path of the standard "Patterns and Practices"

0 comments:

Post a Comment