Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I created a masterpage named "site1" and inserted an updatepanel with a textbox and calendar. when I compile it, it gives error:
The type name 'site1' does not exist in the type 'System.Web.UI.UpdatePanel'
this is the following error:

Line 179: }
Line 180:
Line 181: [TemplateContainer(typeof(Panel.Site1))]
Line 182: [TemplateInstanceAttribute(System.Web.UI.TemplateInstance.Single)]
Line 183: public virtual System.Web.UI.ITemplate Template_head </pre>


Error lies in line 181

What I have tried:

i've tried adding system.web.extensions but have got nowhere..
Posted
Updated 19-Jul-17 3:41am
v3
Comments
F-ES Sitecore 19-Jul-17 5:48am    
Post the relevant bits of markup

1 solution

Hi,

How you didn't post the code and i could not create the error.
I will write all the elements necessary for you create a master page.

Your master page
1 - Scriptmanager component is obrigatory.
C#
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

2 - Updatepanel need to ContentTemplate tag.
C#
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    </ContentTemplate>
</asp:UpdatePanel>

3 - Verify if the namespace is equal in the html and code-behind.
C#
//HTML
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="aplicacao.Site1" %>
//Code-behind
namespace aplicacao {}


Child Page
1 - Add tag master page in child page html.
ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site1.Master" CodeBehind="frmMyTest7.aspx.cs" Inherits="aplicacao.frmMyTest7" %>
<%@ MasterType VirtualPath="~/Site1.Master" %>

2 - Content tag in child page is obrigatory.
ASP.NET
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>


Below is the complete code to help you.

Master Page

HTML
ASP.NET
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <asp:TextBox runat="server"></asp:TextBox>
            <asp:Calendar runat="server"></asp:Calendar>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
            </asp:ContentPlaceHolder>
           </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>


Code-behind
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace aplicacao
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}


Child Page
HTML
ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site1.Master" CodeBehind="frmMyTest7.aspx.cs" Inherits="aplicacao.frmMyTest7" %>
<%@ MasterType VirtualPath="~/Site1.Master" %>

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


Code-behind
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace aplicacao
{
    public partial class frmMyTest7 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
 
Share this answer
 
v2
Comments
Karthik_Mahalingam 20-Jul-17 23:45pm    
5 for your efforts
sam_matte 21-Jul-17 2:59am    
Thank you for going to these lengths to answer my question. It helped a lot. I had made a mistake of naming my project "UpdatePanel" which clashed with the system.web.ui.UpdatePanel namespace, which caused error. I rectified it by renaming my project name. Samrat Matte.
Sheila Pontes 21-Jul-17 9:29am    
I'm glad to help you.

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