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

G

Guest

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>
 
J

Jim Hughes

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 said:
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>
 
G

Guest

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
 
G

Guest

I think I found the problem. It was probably an installation issue. After reinstall, things now work.
Thanks again.
C.E
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top