tags:

views:

3917

answers:

6

(Warning - asp newbie) I have an aspx file with the tag

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

right at the beginning of the file.

When calling this from my IIS server (http://localhost/myservice/default.aspx), this gives me the error

This page contains the following errors:

error on line 1 at column 2: StartTag: invalid element name
Below is a rendering of the page up to the first error.

What am I doing wrong?

+2  A: 

It appears as if the browser tries to display what it thinks is an XML file, since it gives an error on the second character of the first line. So I think the file is not parsed, but simply returned as is immediately. Check if your IIS server is configured correctly and that it actually parses your ASP tags before returning the page.

Daan
Yes, it sounds like ASP.NET isn't installed correctly in IIS. If you can debug this page in VS, then that is definitely the issue.
Will
+1  A: 

When I went into the ASP.NET tab for the virtual directory I noticed the ASP.NET version was not selected (it was an empty combo box). Choosing the .NET framework version did the trick. Thanks.

Epaga
+1  A: 

Similar to the previous comment, in my setup too the ASP.NET version was not selected. But after selecting the version i got the following error while accessing the aspx file. Windows XP, IIS 5.1. Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

Executed the following commands, aspnet_iis -i and aspnet_iis -ga

resolved the issue.

nissam
A: 

When i did this. It worked fine.

Go to this directroy in command prompt C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 Run this command Aspnet_regiis -I

this will install aspnet

Noor Muhammad
A: 

I've tried the command prompt fixes, but I still get the same error massages, is there something else I should try (mostly I just need to know how to select the ASP.NET version). Also please explain the steps in detail so I can figure it out.

mavoc
A: 

dont forget to add the .asmx extension to application mappings...

uur