只允许在包含内容控件的内容页面中直接使用内容控件 [英] Only content controls are allowed directly in a content page that contains content controls

查看:70
本文介绍了只允许在包含内容控件的内容页面中直接使用内容控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i我在iis7中遇到错误..

这是我的代码asp页面..

差不多这么多天单词我找到解决方案,但我得到的结果..



只允许内容控件直接在包含内容控件的内容页面



上面的消息是Comming ..

这里的重要信息是..

in我的本地服务器(ii7)没有错误,但是在

但是在客户端服务器(ii7)中,上面的消息正在传递...

在页面加载时的20个表单中同样的错误即将来临..

可以给我一些建议。




i am getting above error in iis7..
this is my code asp page ..
Nearly so many days on words i am finding the solutions but i am getting the result..

Only content controls are allowed directly in a content page that contains content controls

the above message is Comming..
here important information is ..
in my local server (ii7) no errros are comming but in
but in client server(ii7) the above message is comming..
out of 20 forms at page loading the same error is comming..
can plz give me some suggestions.

<%@ Page Language="VB" MasterPageFile="~/MasterPage1.master" AutoEventWireup="false" CodeFile="HBL_Profile.aspx.vb" Inherits="HBL_Profile" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <%--<%@ Register namespace="AjaxControlToolkit" tagprefix="ajax" %>--%>
<!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">
<script type="text/javascript">
        function ShowButton() {
        document.getElementById('<%=Button1.ClientID%>').click();
        }
    </script>
</html> 

    <asp:Label ID="Label34" runat="server" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Large" ForeColor="Black" 

        Style="z-index: 122; left: 771px; position: absolute; top: 157px; height: 19px; width: 199px; right: 155px;" 

        Text="Professional Details">

    <asp:Label ID="Label30" runat="server" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Large" ForeColor="Black" 

        Style="z-index: 122; left: 771px; position: absolute; top: 41px; height: 19px; width: 156px; right: 198px;" 

        Text="Family Details">
        <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Names="Cambria"

            Font-Size="10pt" ForeColor="White" Style="z-index: 118; left: 525px;
            position: absolute; top: 69px; height: 25px; width: 75px;" 

        Text="UpLoad" BackColor="White" TabIndex="7" BorderColor="White" 

        BorderStyle="Solid" BorderWidth="1px" />





        <asp:Button ID="Button2" runat="server" Font-Bold="True" Font-Names="Cambria"

            Font-Size="10pt" ForeColor="White" Style="z-index: 118; left: 532px;
            position: absolute; top: 505px; height: 25px; width: 75px;" 

        Text="Submit" BackColor="#666666" TabIndex="7" BorderColor="Blue" 

        BorderStyle="Solid" BorderWidth="1px" />




    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
        <div style="overflow:auto; background-color :White ; border-color :White; height:150px; width:760px">
<asp:GridView ID="GridView4" runat="server" CellPadding="4" Font-Names="Cambria" 

                 Style="position:relative; left: -3px; height: 31px; width: 747px; bottom: -1px;" 

                 AutoGenerateColumns="False"    OnRowDeleting="OnRowDeleting" 

                 

                 

        Caption="TRAINING"  Font-Bold="True"

        ForeColor="#333333" GridLines="None" ShowFooter="True" 

    BackColor="#666666">
                   <rowstyle backcolor="#EFF3FB" bordercolor="#F7F6F3" borderstyle="Solid">
                       Height="20px" HorizontalAlign="Center" VerticalAlign="Top" Width="30px" />
                   <footerstyle backcolor="#666666" forecolor="White" font-bold="True" />
                   <pagerstyle forecolor="White" horizontalalign="Center" backcolor="#2461BF" />
                   <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                   <HeaderStyle BackColor="#666666" Font-Bold="True" ForeColor="White" 

                       Font-Size="Small" />
                   
                     <columns>
                     <asp:BoundField DataField="Sno" HeaderText="Sno" />
<asp:TemplateField HeaderText="Training Name">
<itemtemplate>
<asp:TextBox ID="TextBox1" runat="server" Font-Names="Cambria">
</itemtemplate>
    <footertemplate>
        <asp:Button ID="ButtonAdd0" runat="server" Height="22px" Text="Add New Row" OnClick="ButtonAdd_Click"

            Width="117px" />
    </footertemplate>


<asp:TemplateField HeaderText="Status">
<itemtemplate>
<asp:DropDownList ID="DropDownList2" runat="server" 

        AppendDataBoundItems="TRUE"  Font-Names="Cambria">
                <asp:ListItem Value="-1">Select
                
</itemtemplate>


<asp:TemplateField HeaderText="Start Date">
<itemtemplate>
<asp:TextBox ID="TextBox2" runat="server"  Enabled="TRUE" Width="75px" 

        Font-Bold="True"  ReadOnly="TRUE"

        ForeColor="Black" Font-Names="Cambria">
    <asp:ImageButton ID="ImageButton11" runat="server" ImageUrl="~/Images/cal.gif" 

        onclick="ImageButton11_Click" Width="16px" />
    <br />
    <asp:Calendar ID="Calendar1" runat="server" 

        onselectionchanged="Calendar1_SelectionChanged" Visible="False">
    
</itemtemplate>



<asp:TemplateField HeaderText="End Date">
<itemtemplate>
<asp:TextBox ID="TextBox3" runat="server"  Enabled="TRUE" Width="75px" 

        Font-Bold="True"   ReadOnly ="true" 

        ForeColor="Black" Font-Names="Cambria">
    <asp:ImageButton ID="ImageButton22" runat="server" ImageUrl="~/Images/cal.gif" 

        onclick="ImageButton22_Click" Width="16px" />
    <br />
    <asp:Calendar ID="Calendar11" runat="server" 

        onselectionchanged="Calendar11_SelectionChanged" Visible="False">
    
</itemtemplate>

<asp:ButtonField ButtonType="Button" CommandName="Delete" HeaderText="Delete" 

                             ShowHeader="True" Text="Delete" />

</columns>
                   
                   <editrowstyle backcolor="#2461BF" font-names="Cambria" />
                   <alternatingrowstyle backcolor="White" />
               
               </rowstyle></div> 
               <br />
            <br />



        
        <div style="overflow:auto; background-color :White ; border-color :White; height:150px; width:760px">
<asp:GridView ID="GridView5" runat="server" CellPadding="4" Font-Names="Cambria" 

                 Style="position:relative; left: -1px; height: 15px; width: 740px; bottom: -1px;" 

                 AutoGenerateColumns="False"  

                 

                 

        Caption="QUALIFICATION DETAILS"  Font-Bold="True"

        ForeColor="#333333" GridLines="None" ShowFooter="True" 

    BackColor="#666666">
                   <rowstyle backcolor="#EFF3FB" bordercolor="#F7F6F3" borderstyle="Solid">
                       Height="20px" HorizontalAlign="Center" VerticalAlign="Top" Width="30px" />
                   <footerstyle backcolor="#666666" forecolor="White" font-bold="True" />
                   <pagerstyle forecolor="White" horizontalalign="Center" backcolor="#2461BF" />
                   <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                   <HeaderStyle BackColor="#666666" Font-Bold="True" ForeColor="White" 

                       Font-Size="Small" />
                   
              <columns>

<asp:BoundField DataField="Sno" HeaderText="Sno" />
<asp:TemplateField HeaderText="Education Type">
<itemtemplate>
 <asp:DropDownList ID="DropDownList3" runat="server" 

        AppendDataBoundItems="true"  AutoPostBack="True" 

        onselectedindexchanged="DropDownList3_SelectedIndexChanged" 

        Font-Names="Cambria">
                <asp:ListItem Value="-1">Select
                
</itemtemplate>



<asp:TemplateField HeaderText="Degree">
<itemtemplate>
<asp:TextBox ID="TextBox6" runat="server" Font-Names="Cambria">
</itemtemplate>
<footerstyle horizontalalign="Right" />


<asp:TemplateField HeaderText="Start Date">
<itemtemplate>
<asp:TextBox ID="TextBox8"  runat="server"  Enabled="true"  Width="75px" ReadOnly=true

        Font-Bold="True" ForeColor="Black" Font-Names="Cambria">
    <asp:ImageButton ID="ImageButton115" runat="server" ImageUrl="~/Images/cal.gif" 

        onclick="ImageButton115_Click" Width="16px" />
    <br />
    <asp:Calendar ID="Calendar15" runat="server" 

        onselectionchanged="Calendar15_SelectionChanged" Visible="False">
    
</itemtemplate>


<asp:TemplateField HeaderText="End Date">
<itemtemplate>
<asp:TextBox ID="TextBox88" runat="server" Enabled="true"  Width="75px" 

        Font-Bold="True"  ReadOnly="TRUE"

        ForeColor="Black" Font-Names="Cambria">
    <asp:ImageButton ID="ImageButton125" runat="server" ImageUrl="~/Images/cal.gif" 

        onclick="ImageButton125_Click" Width="16px" />
    <br />
    <asp:Calendar ID="Calendar125" runat="server" 

        onselectionchanged="Calendar125_SelectionChanged" Visible="False">
    
</itemtemplate>


</columns>
   <editrowstyle backcolor="#2461BF" />
                   <alternatingrowstyle backcolor="White" />
               
               </rowstyle></div>
               
                                                                
    <asp:Label ID="Label26" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 10px; position: absolute; top: 38px; height: 19px; width: 156px; right: 959px;" 

        Text="Personal Details" BorderStyle="None" BorderWidth="2px" 

        Font-Bold="True" Font-Size="Large" ForeColor="Black">
    <asp:Label ID="Label29" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 10px; position: absolute; top: 131px; height: 16px;" 

        Text="Last Name" Font-Bold="True" Font-Size="Medium" ForeColor="Black">
    <asp:Label ID="Label27" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 10px; position: absolute; top: 101px; height: 16px;" 

        Text="Middle Name" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label44" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 454px; height: 16px;" 

        Text="Home Phone" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label43" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 422px; height: 16px;" 

        Text="Office Phone" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label42" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 392px; height: 16px;" 

        Text="Join Date" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label41" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 362px; height: 16px;" 

        Text="Email Id (Per)" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label40" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 332px; height: 16px;" 

        Text="Email id (Off)" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label39" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 302px; height: 16px;" 

        Text="Manager" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label38" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 272px; height: 16px;" 

        Text="Branch" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label37" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 242px; height: 16px;" 

        Text="Department" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label36" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 212px; height: 16px;" 

        Text="Designation" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label35" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 182px; height: 16px;" 

        Text="Job Title" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label33" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 122px; height: 16px;" 

        Text="Spouse Name" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label32" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 94px; height: 16px;" 

        Text="Mother Name" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label31" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 773px; position: absolute; top: 67px; height: 16px;" 

        Text="Father Name" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
    <asp:Label ID="Label21" runat="server" Font-Names="Cambria" Style="z-index: 122;
        left: 10px; position: absolute; top: 73px; height: 16px;" 

        Text="First Name" Font-Bold="True" Font-Size="Medium" 

    ForeColor="Black">
                                                
                                                                                                                
    <asp:TextBox ID="txtlocalcar1" runat="server" Style="z-index: 138; left: 115px; position: absolute;
        top: 129px"  Width="175px" ReadOnly ="true" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar0" runat="server" Style="z-index: 138; left: 115px; position: absolute;
        top: 100px" ReadOnly="true"  Width="175px"  

        Font-Bold="True" Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar15" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 454px" ReadOnly="FALSE" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar14" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 423px" ReadOnly="true" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium" >
    <asp:TextBox ID="txtlocalcar13" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 393px" ReadOnly="true"   Width="175px" >
    <asp:TextBox ID="txtlocalcar12" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 393px" ReadOnly="TRUE" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar11" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 363px" ReadOnly="false" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar10" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 333px" ReadOnly="true" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium" >
    <asp:TextBox ID="txtlocalcar9" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 303px" ReadOnly="true"  Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar5" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 183px" ReadOnly="true" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium" >
    <asp:TextBox ID="txtlocalcar4" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 123px" ReadOnly="false" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar3" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 95px" ReadOnly="false" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar2" runat="server" Style="z-index: 138; left: 905px; position: absolute;
        top: 66px" ReadOnly="false" Width="175px" Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
    <asp:TextBox ID="txtlocalcar" runat="server" Style="z-index: 138; left: 116px; position: absolute;
        top: 72px" ReadOnly="true" Width="175px"  Font-Bold="True" 

        Font-Names="Cambria" Font-Size="Medium">
        <asp:DropDownList ID="state1" runat="server" Style="z-index: 138; left: 905px; position: absolute;
            position: absolute; top: 273px; width: 180px; height: 22px;" AppendDataBoundItems="True" 

            AutoPostBack="True" Font-Bold="True" Font-Names="Times New Roman" 

          TabIndex="8" Font-Size="Medium" Width="175px"  Enabled="False">
        
        <asp:DropDownList ID="state0" runat="server" Style="z-index: 138; left: 905px; position: absolute;
            position: absolute; top: 243px; width: 180px; height: 22px;" AppendDataBoundItems="True" 

            AutoPostBack="True" Font-Bold="True" Font-Names="Times New Roman" 

          TabIndex="8" Font-Size="Medium" Width="175px" Enabled="False">
        
        <asp:DropDownList ID="state" runat="server" Style="z-index: 138; left: 905px; position: absolute;
            position: absolute; top: 212px; width: 180px; height: 22px;" AppendDataBoundItems="True" 

            AutoPostBack="True" Font-Bold="True" Font-Names="Cambria" 

          TabIndex="8" Font-Size="Medium" Width="175px" Enabled="False">
        
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />

  <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/white7777.jpeg" 



    Style="z-index: 104; left: 633px; position: absolute; top: 39px; width: 97px; height: 113px;" 

    BorderWidth="2px"  />
        <asp:Label ID="Label46" runat="server" Font-Bold="True" Font-Names="Cambria"

        Font-Size="Large" 

        Style="z-index: 102; left: 145px; position: absolute; top: 36px; height: 23px; width: 457px; text-align: center;" 

        ForeColor="#00CC00" BackColor="White">

        <asp:Label ID="Label45" runat="server" Font-Bold="True" Font-Names="Cambria"

        Font-Size="Large" 

        Style="z-index: 102; left: 4px; position: absolute; top: 308px; height: 23px; width: 457px; text-align: center;" 

        ForeColor="Red" BackColor="White">

        <asp:Label ID="Label12" runat="server" Font-Bold="True" Font-Names="Cambria"

        Font-Size="Large" Style="z-index: 102; left: 0px; position: absolute; top: 0px; height: 25px; width: 1128px; text-align: center;"

        Text="USER PROFILE" ForeColor="White" BackColor="#666666">

        <asp:FileUpload ID="FileUpload1" runat="server" Style="z-index: 126; left: 404px;
            position: absolute; top: 130px; width: 179px;" 

        onchange="ShowButton()" Font-Names="Cambria" Font-Size="Small" />
        
    <asp:ImageButton ID="ImageButton2" runat="server" 

        ImageUrl="~/Images/delete.png" 

        Style="z-index: 119; left: 727px; position: absolute; top: 116px; width: 33px; height: 40px;" 

        OnClientClick='return confirm("Chnages Are Effecting in Employee Master Data.Do you Want to Proceed?");' />

推荐答案

You should put your controls inside the content controls with appropriate place holders that are present in Master page. See this for simple example : http://msdn.microsoft.com/en-us/library/wtxbf3hh.ASPX[^]



It too states that

You should put your controls inside the content controls with appropriate place holders that are present in Master page. See this for simple example : http://msdn.microsoft.com/en-us/library/wtxbf3hh.ASPX[^]

It too states that
Quote:

anything that is not inside the Content controls (except script blocks for server code) results in an error.

anything that is not inside the Content controls (except script blocks for server code) results in an error.


这篇关于只允许在包含内容控件的内容页面中直接使用内容控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆