invalid character--newbie

M

Middletree

Teaching myself ASP.NET, using Microsoft Press book called ASP.NET 2.0 by
George Shepherd.

Ch. 2, it says to type the following code:

<%@ Page Language="C#" %>

<html>



<body>

<h1>Hello World</h1>

Nothing really showing here yet, except some HTML...

</body>

</html>



Here's what I see in the browser:



The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

A name was started with an invalid character. Error processing resource
'http://localhost/ASPNETStepByStep/HelloWorld.aspx'...

<%@ Page Language="C#" %>
-^----------------Because of wrapping, you may or may not be able to tell,
but the arrow is pointing to the percent sign, the 2nd character of the
entire page.I am quite sure I followed all directions correctly, and have
spent hours going back over them. Part of those instructions involve setting
up a virtual directory in IIS. I'm running on WinXP SP2. If anyone has any
insights on this, please let me know. TIA.
 
J

John Timney \(MVP\)

Nothing appears wrong with your code, so its something more subtle.

Just to get a stuiped gotcha out of the way - make sure your browsing to
your URL in correct case - make sure your hellp world file is actually
HelloWorld and not helloworld.aspx
http://localhost/ASPNETStepByStep/HelloWorld.aspx

If thats not it - reregister ASP.NET into your IIS server

Run the reg IIS tool (check your framework version though so you run the
correct version) You'll find it somehwere like this.
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i

Fingers crossed!

Regards

John Timney (MVP)
 

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

Top