Very basic beginner question (I hope)

Discussion in 'ASP .Net' started by Chele Sedai, Mar 14, 2005.

  1. Chele Sedai

    Chele Sedai Guest

    I am on my first day of learning ASP.NET (I hope that doesn't chase
    anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    so slow that I need this book to start with). The first exercise is to
    print "Hello and Welcome" on the screen in increasing font size.

    Here is the code which I typed in exactly from the book:

    <%@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>


    Here is the result I get (centered on the screen):

    > Hello and Welcome!



    Can anyone tell me what the problem is?
    Chele Sedai, Mar 14, 2005
    #1
    1. Advertising

  2. Chele Sedai wrote:
    > I am on my first day of learning ASP.NET (I hope that doesn't chase
    > anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    > so slow that I need this book to start with). The first exercise is to
    > print "Hello and Welcome" on the screen in increasing font size.
    >
    > Here is the code which I typed in exactly from the book:
    >
    > <%@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>
    >
    >
    > Here is the result I get (centered on the screen):
    >
    >
    >>Hello and Welcome!

    >
    >
    >
    > Can anyone tell me what the problem is?
    >


    I would assume you're not 'running' the page correctly. Meaning make
    sure you have your virtual directory/web application folder setup
    correctly, and that you named this file with an .aspx suffix. It looks
    like it's not being run by ASP.NET at all....

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Mar 14, 2005
    #2
    1. Advertising

  3. What does the actual HTML look like?

    "Chele Sedai" <> wrote in message
    news:...
    > I am on my first day of learning ASP.NET (I hope that doesn't chase
    > anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    > so slow that I need this book to start with). The first exercise is to
    > print "Hello and Welcome" on the screen in increasing font size.
    >
    > Here is the code which I typed in exactly from the book:
    >
    > <%@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>
    >
    >
    > Here is the result I get (centered on the screen):
    >
    > > Hello and Welcome!

    >
    >
    > Can anyone tell me what the problem is?
    >
    Peter Rilling, Mar 14, 2005
    #3
  4. Chele Sedai

    Karl Seguin Guest

    Chele:
    Code works fine...if you view source are you seeing all that code? You do
    have the .Net framework installed right? You might need to register IIS ala

    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "Chele Sedai" <> wrote in message
    news:...
    > I am on my first day of learning ASP.NET (I hope that doesn't chase
    > anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    > so slow that I need this book to start with). The first exercise is to
    > print "Hello and Welcome" on the screen in increasing font size.
    >
    > Here is the code which I typed in exactly from the book:
    >
    > <%@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>
    >
    >
    > Here is the result I get (centered on the screen):
    >
    > > Hello and Welcome!

    >
    >
    > Can anyone tell me what the problem is?
    >
    Karl Seguin, Mar 14, 2005
    #4
  5. I took this code and placed it in a file called test.aspx and it worked
    as expected. Is this the actual code that you had typed. Try pasting
    this into another file and see how it works.

    Regards,

    Trevor Benedict R
    MCSD

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trevor Benedict R, Mar 14, 2005
    #5
  6. Chele Sedai

    Chele Sedai Guest

    I have installed the .Net Framework and I also installed IIS.

    The file is sitting in the following directory (per the book's
    instructions): inetpub\wwwroot\hello

    (The actual path being inetpub\wwwroot\hello\welcome.aspx)

    To run the file, I open up IE 6, SP 2 and type the following in the
    Address bar: http://localhost/hello/welcome.aspx

    Here is the HTML from View Source:

    <%@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>

    I will try to save the file as a different name and see if I get
    different results.
    Chele Sedai, Mar 14, 2005
    #6
  7. Chele Sedai

    Brock Allen Guest

    Your problem is that you're only viewing the file in the browser from the
    filesystem and not via a webserver that hosts ASP.NET (like IIS). If you
    look in the address bar of the browser does it say:

    file://c:\pathtoyouapp.aspx

    Or does it say:

    http://UrlToYourApp.aspx

    If it's the former then you need to configure your application in IIS or
    some other webserver. If you don't have access to IIS, I'd suggest trying
    WebMatrix[1]

    -Brock
    http://staff.develop.com/ballen

    [1] http://www.asp.net/webmatrix/default.aspx?tabIndex=4&tabId=46


    > I am on my first day of learning ASP.NET (I hope that doesn't chase
    > anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    > so slow that I need this book to start with). The first exercise is to
    > print "Hello and Welcome" on the screen in increasing font size.
    >
    > Here is the code which I typed in exactly from the book:
    >
    > <%@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>
    > Here is the result I get (centered on the screen):
    >
    >> Hello and Welcome!
    >>

    > Can anyone tell me what the problem is?
    >
    Brock Allen, Mar 14, 2005
    #7
  8. Try this :

    <% Dim I As Integer
    For I = 0 to 7 %>
    <font size="<%=I%>"> Hello and Welcome! </font>
    <% Next %>

    Notice the quotes after font size
    and between the greater-than signs



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    Ven, y hablemos de ASP.NET...
    ======================

    "Chele Sedai" <> wrote in message
    news:...
    >I am on my first day of learning ASP.NET (I hope that doesn't chase
    > anyone away from my post!) I am using "ASP.NET For Dummies" (Yes, I am
    > so slow that I need this book to start with). The first exercise is to
    > print "Hello and Welcome" on the screen in increasing font size.
    >
    > Here is the code which I typed in exactly from the book:
    >
    > <%@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>
    >
    >
    > Here is the result I get (centered on the screen):
    >
    >> Hello and Welcome!

    >
    >
    > Can anyone tell me what the problem is?
    >
    Juan T. Llibre, Mar 14, 2005
    #8
  9. Chele Sedai

    Chele Sedai Guest

    Thank you!

    Once I installed Web Matrix and started IIS from there, it ran just
    fine!

    I didn't realize that Web Matrix was a MUST HAVE, but I thought it was
    optional. Thank you for pointing this out!
    Chele Sedai, Mar 14, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. me2u
    Replies:
    2
    Views:
    281
    Saravana [MVP]
    Oct 31, 2003
  2. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    453
    Raymond Hettinger
    Jul 27, 2003
  3. aghazalp

    very very basic question

    aghazalp, Apr 2, 2006, in forum: Python
    Replies:
    6
    Views:
    334
    aghazalp
    Apr 2, 2006
  4. Peter

    Very very very basic question

    Peter, Feb 8, 2005, in forum: C Programming
    Replies:
    14
    Views:
    503
    Dave Thompson
    Feb 14, 2005
  5. mdh

    A very **very** basic question

    mdh, Sep 25, 2008, in forum: C Programming
    Replies:
    57
    Views:
    1,196
    August Karlstrom
    Sep 26, 2008
Loading...

Share This Page