Getting Started in ASP.Net

J

Jerry Spence1

I've written my first asp.net program using VB2005. It has a textbox with
"Hello World". When I run it from the IDE, it comes up OK. I then did a
"publish web" to my local IIS folder and ran the default.aspx file and it
came up with the following:

XML Parsing Error: not well-formed
Location: file:///C:/Inetpub/wwwroot/WebViewer/Default.aspx
Line Number 1, Column 2:<%@ page language="VB" autoeventwireup="false"
inherits="_Default, App_Web_u2trtlt1" %>

What is wrong please?

-Jerry
 
L

Larry Bud

I've written my first asp.net program using VB2005. It has a textbox with
"Hello World". When I run it from the IDE, it comes up OK. I then did a
"publish web" to my local IIS folder and ran the default.aspx file and it
came up with the following:

XML Parsing Error: not well-formed
Location: file:///C:/Inetpub/wwwroot/WebViewer/Default.aspx
Line Number 1, Column 2:<%@ page language="VB" autoeventwireup="false"
inherits="_Default, App_Web_u2trtlt1" %>

What is wrong please?

Sounds like your application isn't configured for ASP.NET in IIS,
because it's seeing the .ASPX file as an XML file instead of a .net
page.
 
J

Jerry Spence1

Larry Bud said:
Sounds like your application isn't configured for ASP.NET in IIS,
because it's seeing the .ASPX file as an XML file instead of a .net
page.

Good point Larry. I've gone though the IIS configuration and it keeps
mentioning ASP.NET so I guess it is, but I'm not sure where to look to be
sure.

-Jerry
 
R

Rob Meade

Good point Larry. I've gone though the IIS configuration and it keeps
mentioning ASP.NET so I guess it is, but I'm not sure where to look to be
sure.

Right click on the item in IIS for your site (either Default Website or the
Virtual Site) - on the Properties window, Home Directory tab, there should
be a box for the application name and a button to "Create" it if it hasn't
already been done, "Remove" if it has. If you have the create button then
type in a name for your application and click create, scripts and
executables and medium pooled seem to be the typical options.

On the Documents tab, check to see if "Default.aspx" is listed. If its not,
you might not have the .net framework installed in IIS (can sometimes happen
if the framework is installed BEFORE IIS), if you have an ASP.Net tab (comes
with .net 2.0 installation) then you should be ok I believe, although for
..net 1.1 you may need to check the script mappings to confirm.

If the drop down on the ASP.Net tab has 1.1.4322 and 2.0.50727 then both
..net 1.1 and 2.0 are installed, ensure you select the appropriate framework
for the application you've just created.

Ok all settings/windows and re launch your app...

Any good?

Rob
 
J

Jerry Spence1

Rob Meade said:
Right click on the item in IIS for your site (either Default Website or
the Virtual Site) - on the Properties window, Home Directory tab, there
should be a box for the application name and a button to "Create" it if it
hasn't already been done, "Remove" if it has. If you have the create
button then type in a name for your application and click create, scripts
and executables and medium pooled seem to be the typical options.

On the Documents tab, check to see if "Default.aspx" is listed. If its
not, you might not have the .net framework installed in IIS (can sometimes
happen if the framework is installed BEFORE IIS), if you have an ASP.Net
tab (comes with .net 2.0 installation) then you should be ok I believe,
although for .net 1.1 you may need to check the script mappings to
confirm.

If the drop down on the ASP.Net tab has 1.1.4322 and 2.0.50727 then both
.net 1.1 and 2.0 are installed, ensure you select the appropriate
framework for the application you've just created.

Ok all settings/windows and re launch your app...

Any good?

Rob
Thank you for all this help. Unfortunately everything seems OK. There is a
default.aspx document listed, and I know that I have 2.0 .Net Framework
installed.

I did a Google search for this problem and I saw a web site whcih suggested
making up a simple file default.htm.
<html>
<body bgcolor="yellow">
<center>
<h2>Hello W3Schools!</h2>
</center>
</body>
</html>This ran OK, as you would expect. They then suggested renaming it to
default.aspx and running it again which should appear the same. When I
opened it in explorer it said:This XML file does not appear to have any
style information associated with it. The document tree is shown
below.<html>- <body bgcolor="yellow">- <center><h2>Hello
W3Schools!</h2></center></body></html>Now this may not have anything to do
with my current problem but this does seem odd. BTW I also tried it in
Mozilla and that didn't work either.-Jerry
 
J

Jerry Spence1

Jon Paal said:
change line 1 to

<%@ page language="VB" %>
Thanks Jon. I get a different error now:

XML Parsing Error: not well-formed
Location: file:///C:/Inetpub/wwwroot/WebViewer/Default.aspx
Line Number 1, Column 2:
<%@ page language="VB" %>
-^

Also how can I change it at source? This is coming from my VB code so I need
to change a config file somewhere?

I have this at the top of my web.config file in VB.

<?xml version="1.0" encoding="iso-8859-1"?>

Is that OK?

-Jerry
 
L

Larry Bud

Also, if you right click on your website in IIS (go to Properties),
there should be an ASP.NET TAB. If not, I would say .NET isn't
installed properly.

On the .NET tab you can choose what version of .NET you'd like to run
if you have both 1.1 and 2.0 installed.

If you click on the Configuration button in the Home Directory tab,
you can look at the application mappings. Find .ASPX and see if it's
pointing to

C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

(or whatever ver your framework is).
 
J

Jerry Spence1

Larry Bud said:
Also, if you right click on your website in IIS (go to Properties),
there should be an ASP.NET TAB. If not, I would say .NET isn't
installed properly.

On the .NET tab you can choose what version of .NET you'd like to run
if you have both 1.1 and 2.0 installed.

If you click on the Configuration button in the Home Directory tab,
you can look at the application mappings. Find .ASPX and see if it's
pointing to

C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

(or whatever ver your framework is).


The last point is interesting as I haven't got an application mapping for
..aspx. I tried to add one and filled in .aspx in the extension box and
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll in the
executable box, but the OK button wouldn't stop being greyed out so I could
save it. Very strange! (Yes I am logged on as Administrator)

-Jerry
 
J

Jerry Spence1

Jon Paal said:
that's the same error. must be an IIS problem then.

http://msdn2.microsoft.com/en-us/library/33487zw6.aspx
I've at long last cracked this one. You have to create things in the right
order:

1. Create the folder under c:\inetpub\wwwroot using Windows Explorer
2. Create a Virtual directory which points to that folder, and give it an
alias
3 In VB.Net, create a new Web Site and point it to the newly created
Virtual directory using "File System"
4. When accessing it, use the full URL
http://localhost/NewFolder/Default.aspx rather than just clicking on the
file.

-Jerry
 
R

Ray

Jerry Spence1 said:
The last point is interesting as I haven't got an application mapping for
.aspx. I tried to add one and filled in .aspx in the extension box and
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll in the
executable box, but the OK button wouldn't stop being greyed out so I could
save it. Very strange! (Yes I am logged on as Administrator)

-Jerry

You don't need to add it manually. Just open the VS .NET
command prompt and run:
aspnet_regiis -i
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top