Oded
Oded

Reputation: 795

ASPX page does not show on Internet Explorer

I've created a new Web Site on VS2005. An ASPX file was created.

when I run the file in VS, it opens via IE and an ASP.NET Development Server icon appears near the clock.

when I try to run the aspx file in IE, I get the error:

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 'file:///C:/Documents and Settings/odedk/My Documen...

<%@ Page Language="VB" AutoEventWireup="false"%>
-^

What can be the problem?

Upvotes: 1

Views: 16600

Answers (4)

Kobi
Kobi

Reputation: 137997

You cannot open an aspx file directly in the browser.
It has to be on the IIS, where the server parses it, run it, and generates meaningful HTML.

The easiest way to do that is (on IIS 6):

  1. Open the IIS. (Control Panel > Administrative Tool).
  2. Go to Web Sites > Default Web Site.
  3. Right Click on Default Web Site, select New > Virtual Directory.
  4. Give it a name (Test) and the path to your files (the root, where you have your web.config).
  5. Check the Run Scripts box.

That's it. Now you can right click on the aspx file on the right, and browse it.
(If it still doesn't work, common problems are ASP.Net not defines, and sometimes windows authentication)

Here's a post with much more details: http://www.iisworkstation.com/2008/06/how-to-create-website-using-iis-6-level.html

Upvotes: 2

David
David

Reputation: 73554

An Aspx page needs to be processed by the web server - either IIS or the web server built into Visual Studio. You can't just browse to it in the file system, double-click on it and have it work.

Instead, in Visual Studio, use right click on the aspx and choose "Set as start page".

Then start the debugger by hitting F5 or the Start Debugging" button.

Edit - added it sounds like you need to know the basics of web development and server-side technology in general, and Asp.Net specifically a bit better.

Here's a very good place to start for beginners.

http://msdn.microsoft.com/en-us/beginner/bb308772.aspx

Upvotes: 3

Brian Schantz
Brian Schantz

Reputation: 511

You may need to run aspnet_regiis.exe from \windows\Microsoft.net\framework\.

http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx

Upvotes: 2

mauris
mauris

Reputation: 43619

It seems like you opened the .aspx file on your hard disk with IE.

You need to open the page via the local server (localhost).

To do this, simply enter http://localhost:PortNo/ in your address bar where PortNo is the port number given by the ASP.NET Development Server.

Upvotes: 3

Related Questions