I am getting the Content controls error in my Master page. I did not leave any tag opened but still getting this error. Can somebody look at my code and point me to my mistake for correction? Can somebody explain me the error via this example?
<%# Master Language="C#" MasterPageFile="~/Data.master" AutoEventWireup="true" CodeFile="IMS.master.cs" Inherits="ims_IMS" %>
<%# MasterType VirtualPath="~/AData.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contenttop" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" Runat="Server">
<div id="section-header" class="clear">
<h2 id="section-title">IMS </h2>
</div>
<de:PageSecurity ID="ps1" runat="server" ContentControlId="contentwrapper" AllowdeStaff="True" AllowTechss="False" AllowPeoples="False" AllowDistrict="True" ErrorMessage="You cannot access this page." />
<div id="section-content">
<asp:ContentPlaceHolder ID="sectioncontent" Runat="Server">
</asp:ContentPlaceHolder>
</div>
</asp:Content>
I'd recommend you remove everything from inside <asp:Content ID="Content3" and see if you still get an error.
Also, try ending your custom control with /> instead of /de>
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown"></asp:scriptmanager>
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Button" xmlns:asp="#unknown" />
<rsweb:reportviewer id="ReportViewer2" runat="server" height="261px" width="476px" xmlns:rsweb="#unknown"></rsweb:reportviewer>
Related
I want to create a subgurim maps control inside a Formview in an asp.net web form page. When I add it to an item template in a formview it wont render. When I place it outside the Formview it renders fine. Is there something I am missing?
Code where it does not render:
<%# Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="maps" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
<div id="content">
<asp:FormView ID="FormView1" runat="server">
<ItemTemplate>
<maps:StaticGMap ID="StaticGMap1" runat="server" format="png32" />
<maps:GMap ID="GMap1" runat="server" />
</ItemTemplate>
</asp:FormView>
</div>
</asp:Content>
The problem is that Formview has not DataSourceID or DataSource. If you set a DataSource for your FormView You will see the map.
I have a basic website with two themes.
But No Themes being recognised in the web page.
Error: Warning 1 Invalid theme or stylesheet theme value. C:\Visual Studio 2010\WebSites\ThemesLab\Default.aspx 1 17 C:...\ThemesLab\
code:
<%# Page Theme="Fabrikam" Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:Image ID="Image1" runat="server" SkinID="Logo" />
<asp:TextBox ID="TextBox1" runat="server" CssClass="textBox"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Hello" CssClass="button" />
</asp:Content>
Any idea how to get it to work?
It seems to be on and off.
Will monitor it over the weeks ahead
I've followed all tutorials exactly (or so I think) and I can't get a modal window to open. Right now, I'm just trying to get one to open in a "test" ASP page, so I can figure out the functionality.
Here is my code for "Test.aspx"
<%# Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act"%>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<act:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
OkControlID="OkButton"
BackgroundCssClass="modalBackground"></act:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="ModalWindow">
<asp:Table Width="100%" runat="server">
<asp:TableRow>
<asp:TableCell>
Fields1:
</asp:TableCell>
<asp:TableCell><asp:TextBox ID="txtFields1" runat="server">
</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Button ID="Button1" runat="server" Text="Submit" />
<asp:Button ID="btnCancel3" runat="server" Text="Cancel" />
</asp:Panel>
<asp:Button ID="LinkButton1" runat="server" Text="Link Button" />
I also put this at the top of Site.Master
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
The error I am getting is this:
http://i.stack.imgur.com/4gCvF.png
If I click to ignore the error, this is what happens
http://i.stack.imgur.com/D0f1k.png
OkControlID="OkButton"
should match the submit button
<asp:Button ID="Button1" runat="server" Text="Submit" />
To close the modal window. You currently don't have a button with the ID "OkButton"
EDIT:
Also, you want to use
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server" > </asp:ToolkitScriptManager>
instead of
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
(or in your case I think you want to use <act:ToolkitScriptManager... but I'm not a pro so play with it)
Note: I figured this out a few days ago, and I had to add the attribute CombineScripts="false" to the ToolkitScriptManager to get it to work, but I think this depends on your environment and what other javascript files you have running
So I have a file called WebParts.aspx which looks like this -
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="WebParts.aspx.cs" Inherits="e.WebParts" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:TabContainer ID="TabContainer1" runat="server">
<asp:TabPanel ID="TabPanel1" runat="server">
<ContentTemplate>Page One</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel2" runat="server">
<ContentTemplate>Page Two</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel3" runat="server">
<ContentTemplate>Page Three</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
</form>
</body>
</html>
And that produces the desired results of creating 3 tab panels inside a tab container.
However, when I change that page to use a MasterPage.master to look like this -
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="WebParts.aspx.cs" Inherits="eservice.WebParts" MasterPageFile="~/MasterPage.Master"%>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<p id="backtoblog"></p>
<p> Preferences</p>
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:TabContainer ID="TabContainer1" runat="server">
<asp:TabPanel ID="TabPanel1" runat="server">
<ContentTemplate>Page One</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel2" runat="server">
<ContentTemplate>Page Two</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="TabPanel3" runat="server">
<ContentTemplate>Page Three</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
</div>
</LoggedInTemplate>
<AnonymousTemplate>
You are not logged in.
<br />
Please login to access eservice
</AnonymousTemplate>
</asp:LoginView>
</asp:Content>
VS2008 gives me the following warning:
Element 'ToolkitScriptManager' is not
a known element. This can occur if
there is a compilation error in the
Web site, or the web.config file is
missing.
on the following line:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
Your second file does not contain the line
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
which you have in your first file. Just because the master page knows about the asp: prefix and the assembly/namespace you've associated to it, doesn't mean that the child page does.
A better approach would be to register the assembly/namespace/tag prefix inside your web.config, like so:
<configuration>
<!-- ... -->
<system.web>
<!-- ... -->
<pages>
<controls>
<add tagPrefix="asp"
namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
</configuration>
Element 'ToolkitScriptManager' is not a known element. This can occur
if there is a compilation error in the Web site, or the web.config
file is missing.
Just in case someone runs across this. The fix for me, was that the imported project properties pointed to 4.5.2 framework. I selected an older framework, and then selected 4.5.2 again. This got rid of the mentioned error along with dozens of others.
I have a web site developed on VS2005. that compiles fine.
But when i try to publish it whit the "Allow this web site to be updatable" i get the following compiller error:
error BC30002: The type 'ASP.ucDireccion' is not defined.
The problem seams to be related to a user control im accesing its public properties and methods.
I have the user control on the page and have also put the <#register> directive on the page.
here is the relevant code where te compiler indicates the errors
- Private Sub CargarDireccionAControl(ByVal ctrlDireccion As ASP.ucDireccion)
- Dim ctrl As ASP.ucDireccion = CType(Me.pnl_AdicionarSolicitudes.FindControl(id_Control), ASP.ucDireccion)
and several others
Here are the relevant parts of the ASPX page:
<%# Page EnableEventValidation="false" Language="VB" MasterPageFile="~/Principal.master"
AutoEventWireup="false" CodeFile="AV_SolicitudVerificacion.aspx.vb" Inherits="Verificaciones_AV_SolicitudVerificacion"
Title="Untitled Page" %>
<%# Register Src="wucMapa.ascx" TagName="wucMapa" TagPrefix="uc2" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%# Register Src="../UserControls/ucDireccion.ascx" TagName="ucDireccion" TagPrefix="uc1" %>
<%# Reference Control="../UserControls/ucDireccion.ascx" %>
<%# MasterType VirtualPath="~/Principal.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ContentTemplate>
<asp:UpdatePanel ID="up_Solicitudes" runat="server">
<ContentTemplate>
...
...
...
<cc1:CollapsiblePanelExtender ID="cpeMapa" runat="server" Collapsed="True" TargetControlID="pnl_mapa">
</cc1:CollapsiblePanelExtender>
<asp:Panel ID="pnl_mapa" runat="server" BorderColor="WhiteSmoke" ForeColor="Black" BackColor="White" BorderStyle="Solid" HorizontalAlign="Center">
<uc2:wucMapa ID="wucMapa1" runat="Server" />
<asp:Button ID="bt_CancelarMapa" CssClass= "boton_azul" runat="server" CausesValidation="False" Text="Cancelar" OnClick="cancelarSolicitud"/></asp:Panel>
<uc1:ucDireccion ID="ucSolicitudDomicilio1" runat="server" TipoSolicitud="Domicilio"
Visible="false" />
<uc1:ucDireccion ID="UcSolicitudTrabajo1" runat="server" TipoSolicitud="Trabajo"
Visible="false" />
<uc1:ucDireccion ID="UcSolicitudTrabajo2" runat="server" TipoSolicitud="Trabajo"
Visible="false" />
<uc1:ucDireccion ID="UcSolicitudTrabajo3" runat="server" TipoSolicitud="Trabajo"
Visible="false" />
<uc1:ucDireccion ID="UcSolicitudTrabajo4" runat="server" TipoSolicitud="Trabajo"
Visible="false" />
<uc1:ucDireccion ID="UcSolicitudTrabajo5" runat="server" TipoSolicitud="Trabajo"
Visible="false" />
</ContentTemplate>
</asp:UpdatePanel>
...
...
the user control relevant parts
<%# Control className="ucDireccion" Language="VB" AutoEventWireup="false" CodeFile="ucDireccion.ascx.vb" Inherits="ucDireccion" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
...
...
You should note that when i unchek the "Allow this web site to be updatable" option of the publish dialag. it works fine.
Thanks very much for your time
Regards Hugo
Why is this line:
<%# Reference Control="../UserControls/ucDireccion.ascx" %>
surrounded with **?
What happens when it's included first thing in the page or just after the #Page directive? I'd say that putting it may solve the problem.
Also check this post if you haven't already:
http://rbgupta.blogspot.com/2007/06/turning-ascx-user-control-into.html