I'm developing a .net web project using Visual Studio 2010. I'm trying to publish locally the project using the File System method. But when accessing the default.aspx page from my web browser the following error is outputted:
error on line 1 at column 2: StartTag: invalid element name
Related posts in this site didn't gave me a valid solution.
How can I solve this problem?
This is my Code:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="PresentationLayer._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Main Page
</h2>
<table>
<tr>
<td>
<asp:TextBox ID="txtSpeech" runat="server"></asp:TextBox></td>
<td>
<asp:Button ID="btnValidate" runat="server" Text="Validate"
onclick="btnValidate_Click" ValidationGroup="Validations" />
</td>
<td>
<asp:Button ID="btnSpeach" runat="server" Text="Play"
onclick="btnSpeach_Click" /></td>
<td>
<asp:Button ID="btnNewText" runat="server" Text="New" onclick="btnNewText_Click" /></td>
</tr>
<tr>
<td>
<asp:Label ID="lblText" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label ID="lblValidation" runat="server" Text=""></asp:Label>
</td> </tr>
<tr>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtSpeech" ErrorMessage="Required Field"
ValidationGroup="Validations" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtSpeech" ErrorMessage="Incorrect Input" ForeColor="Red"
MaximumValue="15" MinimumValue="0" Type="Integer" ValidationGroup="Validations"></asp:RangeValidator>
</td>
</tr>
</table>
</asp:Content>
I get this error if I try to directly open the file from the file system in Google Chrome. You actually need to host your site in IIS for it to work properly. Then browse to the url setup in IIS.