Use of aspx with IIS 5.1 and error with showing in browser

H

Hugo Lefèvre

Dear,

I have made an aspx page and I want to start it via explorer to see how it
looks in my browser. But when I click at it I receive the next 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:/Inetpub/wwwroot/login.aspx'. Line 1, P...
<% Page language="C#" %>
--^


I use IIS 5.1 and my default web site is c:/inetpub/wwwroot.This page
login.aspx is saved at c:\inetpub\wwwroot. Which option had I have
forgotten?
And why do I receive c:/inetpub/wwwroot instead of http:\\localhost?
This is the code:

<% Page language="C#" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs e)
{
//If the page has posted back results, then check them
if(IsPostBack) {
//Grab the username and password fields
String strUserName = Request["username"];
String strPassword = Request["password"];

//Write out a success/failure message
if((strUserName == "Joe Smith") &&
(strPassword == "secret")) {
Response.Write("<h2>You have successfully logged on "
+ strUserName + "</h2>");
}
else {
Response.Write("<h2>Your username and password " +
"combination was not found.</h2>");
}
}
}
</script>

<html>
<body>
<h2>Welcome to the Sample Login Page</h2>
<form runat="server">
<table>
<tr>
<td>UserName:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Login">
</td>
</tr>
</table>
</form>
</body>
</html>


Who can help me?

Thanks you very much,

Hugo
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top