Click here to Skip to main content
15,906,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am new in .Net programming,so kindly please help me on below.

Thanks in Advance.

This is my Default Page:

XML
<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="MangerComposemessge.aspx.cs" Inherits="MangerComposemessge" Title="Untitled Page" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
        .style1
        {
            width: 100%;
            border: 6px solid #FFFFCC;
            background-color: #FFFFCC;
        }
        .style2
        {
            width: 228px;
        }
    </style>

</asp:Content>
<asp:Content ID="Content2" runat="Server" ContentPlaceHolderID="ContentPlaceHolder1" >
<form id="frm" runat="server">

    <p>
        &
    </p>
    <p>
        &
        <table class="style1">
            <tr>
                <td class="style2">
        
        <asp:Label ID="Label4" runat="server" Text="TO"></asp:Label>
                </td>
                <td>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

        <asp:TextBox ID="TextBox1" runat="server" Width="222px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
        
        <asp:Label ID="Label5" runat="server" Text="Subject"></asp:Label>
                </td>
                <td>

 <asp:TextBox ID="TextBox2" runat="server" Width="223px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
        
        <asp:Label ID="Label6" runat="server" Text="Message"></asp:Label>
                </td>
                <td>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox3" runat="server" Height="97px" TextMode="MultiLine"
            Width="315px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    
                    <asp:Label ID="Label7" runat="server" Text="Attachment"></asp:Label>
                </td>
                <td>
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
        <asp:Button ID="Button2" runat="server" Text="Browse" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Send" />
                </td>
            </tr>
        </table>
        <br />
    </p>

    </form>
</asp:Content>



This is my master page that i copied it from another one:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Manager.master.cs" Inherits="Admin" %>

<!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 runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">

</head>
<body alink="#ffffcc">
<form id="form1" runat="server">



style="font-size: xx-large; font-weight: bold; font-style: normal; color: #3399FF; background-color: #FFFFCC; height: 142px; width: 961px;">






Payroll Management System



<asp:Menu ID="Menu1" runat="server" BackColor="#B5C7DE"
DynamicHorizontalOffset="2" Font-Bold="True" Font-Names="Verdana"
Font-Size="0.8em" ForeColor="White" Height="21px" Orientation="Horizontal"
StaticSubMenuIndent="10px" Width="482px"
onmenuitemclick="Menu1_MenuItemClick">
<staticmenustyle backcolor="#0080C0">
<staticselectedstyle backcolor="#507CD1">
<staticmenuitemstyle horizontalpadding="5px" verticalpadding="2px">
<dynamichoverstyle backcolor="#284E98" forecolor="White">
<dynamicmenustyle backcolor="#B5C7DE">
<dynamicselectedstyle backcolor="#507CD1">
<dynamicmenuitemstyle horizontalpadding="5px" verticalpadding="2px">
<statichoverstyle backcolor="#284E98" forecolor="White">
<items>
<asp:MenuItem Text="Home" Value="Home">
<asp:MenuItem Text="Employees" Value="Employees">
<asp:MenuItem NavigateUrl="~/Employee list.aspx" Text="Employee List"
Value="Employee List">

<asp:MenuItem Text="Messages" Value="Messages">
<asp:MenuItem Text="Compose Mail" Value="Compose Mail">
<asp:MenuItem Text="Inbox" Value="Inbox">
<asp:MenuItem Text="Outbox" Value="Outbox">

<asp:MenuItem Text="Payslip" Value="Payslip">
<asp:MenuItem Text="Employee Payslip" Value="Employee Payslip">
<asp:MenuItem Text="Genrate Payslip" Value="Genrate Payslip">

<asp:MenuItem Text="Log Out" Value="Log Out">




</form>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">






</body>
</html>
Posted
Updated 12-Oct-13 22:35pm
v3
Comments
JoCodes 13-Oct-13 4:22am    
Please format and post your code since its not easily readable .

Your question is not well formatted.
This error came up because you tried to add a form to a content page relying on a master page.
Once you have a form in master page you cant add any other form to individual content page relying on it..
 
Share this answer
 
Only one form element is allowed in a page even if we are using a combination of master page and content page. You can remove tag from the child page since already your master page contains the form tag and it will work .
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900