Monday, March 26, 2012

Please help - very simple question.

I'm just getting started with ASP/ASP.NET. I have W2k, installed IIS/.Netv1.1, and using the webmatrix to develop. When I use the web matrix server to test, all is OK. But if I use IIS then I cannot run any of the quickstart samples or even my own simple hello world project. The error occurs at any line that has
 <SCRIPT runat="server">
.

The browser (IE6) gives me an error stating Expected ";" on line 3
<FULL CODE BELOW>


==========================================================
<%@dotnet.itags.org. Page Language="VB" %>
<script runat="server"
Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = "Hello " & TextBox1.Text & " you selected: " & Calendar1.SelectedDate
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:Label id="Label1" runat="server">Label</asp:Label>
</p>
<p>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
</p>
<!-- Insert content here -->
</form>
</body>
</html>


=======================================END CODE==========
Please help
MikeDo you have ASP.NET installed on the server? Have you named the page with an .aspx extension?
Yes. the page is named with an .aspx extension.

I am using the same machine to test as I am to write the code. I have the .Net v 1.1 Framework installed on this same machine. I was under the impression that all I need to start is the .Netv1.1 and I am using the webmatrix to develop with.

Could it be something with the virtual path created in the Webmatrix that does not have the proper ASPNET permissions?
OK. This is an error in the browser, correct? If you look in th source code (View/Source) is the script block in the rendered HTML? If so, then ASP.NET is not registered correctly in the folder where you are running from.

Is the folder registered in IIS?
Yes, you can see the <SCRIPT> blocks as you see the code as in my first post!

In IIS there is a virtual folder called "Testing." from which my newfile.aspx is located.
Properties of Testing are:
Virtual Directory properties are to a path on my local machine.
D&S/A/My Docs/... with Read/Log/& index. Execute Permissions = Scripts only

When I look at the config button for the app mappings, I only see asp.dll . Is there not an aspx.dll or something similar? I bet this is my problem. Why not installed when I either installed .NETv1.1 or webmatrix? This should be easy.
Again, I am not sure what you mean by registered in IIS. Is there a .dll that may not be registered, or configured in IIS? How can I check to see if IIS installation will process .NETv1.1 correctly.

Again, the error occures at the browser stating - Expected ";" at any <SCRIPT runat="server"> line.

Thanks Again. Mike
You need to go to the IIS application (Control Panel/Administrative Tools/Internet Information Services or similar) and make sure that the folder you are using is set up as a virtual directory.
See below==============from prior post.
In IIS there is a virtual folder called "Testing." from which my newfile.aspx is located.
Properties of Testing are:
Virtual Directory properties are to a path on my local machine.
D&S/A/My Docs/... with Read/Log/& index. Execute Permissions = Scripts only

If I click on the Configuration button, and on the App Mappings tab, I do not see a .dll for ASP.NET like I do for the old asp (asp.dll)

Is there suppost to be a aspx.dll (or some .Net dll to drive an .aspx web site)? And if so, should it show up in this location...
After much research, I have discovered what the issue was.

In IIS under the Virtural Directory properties page:

and after clicking on the configuration button, I discovered that there were was not a setting for .aspx extension. I added the aspnet_isapi.dll to the list and once I ran the test page it worked!

Wow, I cannot belive that I was the only one to have this problem. I have not read anywhere that a user would have to manually apply this .dll to the app mappings tab in order to display an .aspx page!

Thank You.
Mike Griggs
You would virtually never manually add the DLL (and this likely will not completely fix all problems - if you only associated ASPX, ASMX files (Web Services) will likely not work.

Commonly, running aspnet_regiis -i is what folks do to get the folder set up correctly. This often is caused by installing IIS after installing ASP.NET.
I think what may have happened is that I tried to install the dotnetfx.exe file BEFORE installing the .NET Framework. I did uninstall and then reinstall each componet:

.NET Framework v1.1 then
.NET Framework Version 1.1 Redistributable Package

I did notice that during the redist process that aspnet_regiis -i did run. However, I manually added the DLL prior to re-running the redist package. (However, I did not check this prior to uninstalling the two) I dont know if the package added the DLL to the configuration tab or not. I think that I am good on this issue for now...I am now able to run my simple Hello World aspx after hours of trying...

Now I am ready to get started. Watch Out...Mike

0 comments:

Post a Comment