c# - Runat error in aspx file -


i have login form code master page seen error when run on browser. cannot understand error, how can remove it? error picture attached. please can me?

my code is:

<%@ page title="" language="c#" masterpagefile="~/masterpage.master" autoeventwireup="true" codefile="login.aspx.cs"  inherits="login" %>  <%@ mastertype virtualpath="~/masterpage.master" %> <asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"> <title>login form</title> </head> <body> <form id="form1" runat="server"> <div> <table align="center">  <b>login form</b>  <tr> <td> username: </td> <td> <asp:textbox id="txtusername" runat="server"/> <asp:requiredfieldvalidator id="rfvuser" errormessage="please enter username" controltovalidate="txtusername" runat="server" /> </td> </tr> <tr> <td> password: </td> <td> <asp:textbox id="txtpwd" runat="server" textmode="password"/> <asp:requiredfieldvalidator id="rfvpwd" runat="server" controltovalidate="txtpwd" errormessage="please enter password"/> </td> </tr> <tr> <td> </td> <td> <asp:button id="btnsubmit" runat="server" text="submit" onclick="btnsubmit_click" /> </td> </tr> </table> </div> </form> </body> </html> </asp:content> 

master page code :

<%@ master language="c#" autoeventwireup="true" codefile="masterpage.master.cs" inherits="masterpage" %>  <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml" > <head id="head1" runat="server">     <title>untitled page</title> </head> <body style="background-color:teal;">      <form id="form1" runat="server">     <div align="center">         <h1>my test website</h1>         <div align = "left">             <asp:label id="lblpagename" runat="server"></asp:label>          <asp:menu id="menu1" runat="server" backcolor="#b5c7de" dynamichorizontaloffset="3"             font-names="verdana" font-size="1em" forecolor="#284e98" orientation="horizontal"             staticsubmenuindent="20px" height="25px" width="550px">             <staticmenuitemstyle horizontalpadding="5px" verticalpadding="3px" />             <dynamichoverstyle backcolor="#284e98" forecolor="white" />             <dynamicmenustyle backcolor="#b5c7de" />             <staticselectedstyle backcolor="#507cd1" />             <dynamicselectedstyle backcolor="#507cd1" />             <dynamicmenuitemstyle horizontalpadding="5px" verticalpadding="2px" />             <items>                 <asp:menuitem text="home" value="home" navigateurl="~/default.aspx"></asp:menuitem>                 <asp:menuitem text="about" value="about" navigateurl="~/about.aspx"></asp:menuitem>                 <asp:menuitem text="contact" value="contact" navigateurl="~/contact.aspx"></asp:menuitem>                 <asp:menuitem navigateurl="~/change.aspx" text="change" value="change"></asp:menuitem>                 <asp:menuitem text="login" value="login" navigateurl="~/login.aspx"></asp:menuitem>             </items>             <statichoverstyle backcolor="#284e98" forecolor="white" />         </asp:menu>          </div>         <!-- here have content place holder content pages render controls   -->         <hr />         <asp:contentplaceholder id="contentplaceholder1" runat="server">         </asp:contentplaceholder>      </div>     </form> </body> </html> 

the error picture is: enter image description here

you using masterpage has head tag, that's why error. remove content page.

<asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <div> <table align="center"> <b>login form</b> .... 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -