Does an .aspx file need to be compiled before being used?

Discussion in 'ASP .Net' started by =?Utf-8?B?Q29ubmllIEVkd2FyZHM=?=, Jan 22, 2004.

  1. The following page.aspx is a very simple sample. But when I try to load it, it just prints 'ABCDED' as against making it a link. So, I was wondering if this file will first need to be compiled before being used. And if it needs to be compiled, how to do it? I have only .NET framework SDK. Don't have Visual Studio.NET yet.

    Thanks in advance for any help.

    <script runat="server">
    Sub Page_Load
    link1.HRef="http://www.w3schools.com"
    End Sub
    </script><html><body><form runat="server"><a id="link1" runat="server">ABCDEF</a></form></body></html>
    =?Utf-8?B?Q29ubmllIEVkd2FyZHM=?=, Jan 22, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?Q29ubmllIEVkd2FyZHM=?=

    Jim Hughes Guest

    You need to tell it that it is an ASPX page with the @Page directive. I also
    added a line to change the displayed text.

    Compilation is not required unless you are using code behind. It will
    compile automatically if you also add the Src= attribute.

    <%@ Page Language="vb" AutoEventWireup="true" %>
    <html>
    <script runat="server">
    Sub Page_Load
    link1.href="http://www.w3schools.com"
    link1.innerText = "W3 School"
    End Sub
    </script>
    <body>
    <form runat="server" id="Form1">
    <a id="link1" runat="server">ABCDEF</a></form>
    </body>
    </html>


    "Connie Edwards" <> wrote in message
    news:...
    > The following page.aspx is a very simple sample. But when I try to load

    it, it just prints 'ABCDED' as against making it a link. So, I was wondering
    if this file will first need to be compiled before being used. And if it
    needs to be compiled, how to do it? I have only .NET framework SDK. Don't
    have Visual Studio.NET yet.
    >
    > Thanks in advance for any help.
    >
    > <script runat="server">
    > Sub Page_Load
    > link1.HRef="http://www.w3schools.com"
    > End Sub
    > </script><html><body><form runat="server"><a id="link1"

    runat="server">ABCDEF</a></form></body></html>
    Jim Hughes, Jan 22, 2004
    #2
    1. Advertising

  3. Thanks Jim for the reply, but it hasn't helped yet. I still get the same results.
    I am now beginning to wonder if ASP.NET is installed correctly on my machine. I have every reason to believe it has. I have IIS up and running, and selected every possible option in Add/Remove dialog box for IIS. Is there any switch in IIS (or at any other place) that I will need to turn on in order to get ASP.NET to work??

    Again, thanks in advance for any help.
    C.E
    =?Utf-8?B?Q29ubmllIEVkd2FyZHM=?=, Jan 22, 2004
    #3
  4. I think I found the problem. It was probably an installation issue. After reinstall, things now work.
    Thanks again.
    C.E
    =?Utf-8?B?Q29ubmllIEVkd2FyZHM=?=, Jan 23, 2004
    #4
    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.

Share This Page