I have referenced multiple user controls within the web.config file, because I was receiving an error in the individual pages and they are used in multiple pages, the code I wrote is as follows:
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="IPAMControl" tagName="confirm_list" src="~/Controls/confirmed_participant_list.ascx"/>
<add tagPrefix="IPAMControl" tagName="contact_us" src="~/Controls/contact_us.ascx" />
<add tagPrefix="IPAMControl" tagName="erh_list" src="~/Controls/erh_list.ascx" />
<add tagPrefix="IPAMControl" tagName="graphic_with_thumbnail" src="~/Controls/graphic_with_thumbnail.ascx" />
<add tagPrefix="IPAMControl" tagName="header" src="~/Controls/header.ascx" />
<add tagPrefix="IPAMControl" tagName="footer" src="~/Controls/footer.ascx" />
<add tagPrefix="IPAMControl" tagName="main_tnavbar" src="~/Controls/main_tnavbar.ascx" />
<add tagPrefix="IPAMControl" tagName="program_header" src="~/Controls/program_header.ascx" />
<add tagPrefix="IPAMControl" tagName="program_list" src="~/Controls/program_list.ascx" />
<add tagPrefix="IPAMControl" tagName="signup_section" src="~/Controls/signup_section.ascx" />
<add tagPrefix="IPAMControl" tagName="speaker_list" src="~/Controls/speaker_list.ascx" />
<add tagPrefix="IPAMControl" tagName="track" src="~/Controls/track.ascx" />
</controls>
</pages>
However, when I go into the HTML markup file (aspx) and beging typing "<IPAM..." nothing appears and I get an error of "Unrecognized namespace 'IPAMControls'.
Below is a sample page I am trying to insert one of the controls into:
<%# Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterNew.master" CodeFile="~/programs/programs.aspx.cs" Inherits="IPAM.Website.programs.programs" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="Main" Runat="Server">
<h1>Upcoming Programs</h1>
<hr size="1">
<p align="center">Long Programs | Workshops | Affiliates' & Other Workshops | Summer Programs & Special Events
</p>
Our upcoming programs include long programs, short programs (workshops), reunion conferences, and summer programs. Click on the program title for detailed information.
<%--<a name="long"><ipam:program_list id="idProgramList1" Type="Long" Time="Upcoming" runat="server" /></a>
<a name="workshops"><ipam:program_list id="idProgramList2" Type="Short" Time="Upcoming" runat="server" /></a>
<a name="affiliate"><ipam:program_list id="idProgramList3" Type="Affiliate" Time="Upcoming" runat="server" /></a>
<a name="summer"><ipam:program_list id="idProgramList5" Type="Summer" Time="Upcoming" runat="server" /></a>
<a name="special"><ipam:program_list ID="idProgramList6" Type="Special" Time="Upcoming" runat="server" /></a>--%>
</asp:Content>
What am I doing wrong or missing.
You use user controls like this:
<IPAMControl:confirm_list ID="<id>" runat="server"></IPAMControl:confirm_list>
I use VS2008 and it doesn't come up in my intellisense either.
[Edit]
<%# Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="accesscontrol_test" %>
<%# Register TagPrefix="IPAMControl" TagName="confirm_list" Src="Copy of nav.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="NEContent" Runat="Server">
<h1>Upcoming Programs</h1>
<hr size="1">
<p align="center"><a href="#long" >Long Programs</a></p>
Our upcoming programs include long programs, short programs (workshops), reunion
conferences, and summer programs. Click on the program title for detailed information.
<a name="long"><IPAMControl:confirm_list id="idconfirm_list" runat="server">
</IPAMControl:confirm_list></a>
</asp:Content>
The above code works fine for me, try registering it at the top of the page like I did, then we can help pinpoint what's causing the issue. You'll obviously have to change the directives, but register it in the page and not the web config.
[Edit]
Try adding this to your web config in <pages><controls>
<add tagPrefix="IMAPControl" namespace="IMAP.Webmaster.Controls" assembly="IMAP.Webmaster" />
Related
Problem Statement
When an event is fired, the updateprogress runs indefinitely and the update panel is not refreshed or the request does not end in IIS 8.5 (Windows Server 2012).
Code for reference below
MasterPage
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="XXXMaster.Master.cs" Inherits="XXXWeb.Common.MasterPage.CoReMQWebSite" %>
<asp:ScriptManager ID="ScriptManagerMain" runat="server" EnablePartialRendering="true" >
</asp:ScriptManager>
<asp:UpdateProgress ID="Updprg" runat="server">
<ProgressTemplate>
<div id="divProgress">
<table width="100%">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="lblProcessing" runat="server" CssClass="FieldLabel" Text="Processing... " />
</td>
</tr>
</table>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
}
function EndRequestHandler(sender, args) {
//debugger;
//if UpdatePanel error occurs...
if (args.get_error() != undefined) {
var Error = "Error Occurred: [Code]:" +
args.get_response().get_statusCode() + " [Message]: ";
alert(Error);
//Hide default ajax error popup
args.set_errorHandled(true);
//...redirect error to your Error Panel on page
//document.getElementById("Label1").innerText = Error;
}
}
</script>
aspx page
---------
<%# Page Language="C#" MasterPageFile="~/XXXMaster.Master" AutoEventWireup="true" ClientIDMode="AutoID" EnableEventValidation="false" CodeBehind="CommonAdminScreen.aspx.cs" Inherits="CoReMQWeb.CommonAdminScreen" Title="Common Admin Screen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upCommonAdmin" runat="server">
<ContentTemplate>
<asp:Button runat="server" ID="btnSaveCommonAdmin" CssClass="btn" onmouseout="this.className='btn'" onmouseover="this.className='btn btnhov'" Text="Save" CausesValidation="false" Width="75px" onclick="btnSaveCommonAdmin_Click" Visible="false"/>
<!-- then there is a grid to be updated on button click -->
Things already tried
Adding handlers in web.config
Web.config
<!--<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>-->
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
<authentication mode="Windows"/>
-->
<!--<authentication mode="Windows" />-->
<authentication mode="Forms">
<forms loginUrl="logon.ashx" name="AuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<trust level="Full" originUrl="" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="Off" defaultRedirect="ErrorPageInternal.aspx" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<!--<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>-->
<!--<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>-->
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
The .Net framework is 4.5.2
In a mid of crisis, to make this workable before Friday. Any help/leads will be highly appreciated.
Thanks in advance.
For my web application created an aspx page which should display the ASP.NET Charts. Able to generate the charts but not displaying on the page. I can see the generated charts in my 'Temp charts' folder.
I am using ASP.Net 4 and .NET Framework 4 and done the following.
Code is:
<%# Import Namespace="System" %>
<%# Import Namespace="System.Web" %>
<%# Import Namespace="System.Web.UI" %>
<%# Import Namespace="System.Web.UI.HtmlControls" %>
<%# Import Namespace="System.Web.UI.WebControls" %>
<%# Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%# Import Namespace="System.Xml.Linq" %>
<%# Import Namespace="System.Collections.Generic" %>
<%# Import Namespace="System.Collections" %>
<%# Import Namespace="System.Linq" %>
<%# Import Namespace="System.Web.UI.DataVisualization" %>
<%# Import Namespace="System.Drawing" %>
<%# Import Namespace="System.Data.SqlClient" %>
<%# Import Namespace="System.Web.UI.DataVisualization.Charting" %>
<%# Page Language="C#" %>
<%# Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
}
</script>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:Chart ID="Chart1" runat="server" ImageLocation="~/TempCharts/ChartPic_#SEQ(200,2)" Height="200px" Width="535px" >
<BorderSkin />
<Series>
<asp:Series Name="Series1" ChartType="Pie" YValuesPerPoint="2" >
<Points>
<asp:DataPoint AxisLabel="4 letter" YValues="20,0" />
<asp:DataPoint AxisLabel="5 letter" YValues="10,0" />
<asp:DataPoint AxisLabel="6 letter" YValues="5,0" />
<asp:DataPoint AxisLabel="7 letter" YValues="16,0" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" >
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</div>
</form>
</body>
</html>
And added the below to web.config:
<appSettings>
<add key="ChartImageHandler" value="storage=memory;timeout=30;" />
</appSettings>
<system.webServer>
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
But I am not able to see the Chart on page. Am I missing any?
Solved: Added ImageStorageMode attribute to <asp:Chart> and set value "UseImageLocation" .
try to change your appSetting from
<appSettings>
<add key="ChartImageHandler" value="storage=memory;timeout=30;" />
</appSettings>
to this
<appSettings>
<add key="ChartImageHandler" value="storage=memory;timeout=30;privateImages=false" />
</appSettings>
When set to true, the generated image can only be downloaded by its owner if some of the following types of identifications are enforced:
The user is authenticated.
AnonymousID is enabled.
SessionID is available.
The default value is true.
Here's a complete Web.Config for chart settings:
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=30;dir=~/TempCharts/;"/>
</appSettings>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies</compilation>
</system.web>
</configuration>
Compare it to your current Web.Config file and see what's missing, and try to create a new empty project, add the reference to System.Web.DataVisualization.dll and it should add the chart setting automatically to the Web.Config file.
Hope this helps.
Afternoon All,
I have spent a good chunk of my time on the internet tryiong to solve the below issue but im getting myself a little confused. I am new to .net and im working in VS 2010.
Im trying to get a simple calendar to work with an image and a text box. I have the AjaxControlToolkit.dll (Version 3.5). I the following error when trying to get this calender to work:
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Here is my .aspx code (Which has a blue line right at the top of the page which states that there is a system.we.extensions error, but i already have this in my web config file?)
<%# Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!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">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></cc1:ToolkitScriptManager>
<div>
<asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/images/calendar.gif"
AlternateText="Click here to display calendar" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:calendarextender ID="CalendarExtender1" runat="server"
TargetControlID="TextBox1" PopupButtonID="ImageButton1">
</cc1:calendarextender>
</div>
</form>
</body>
</html>
And here is my web config file:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="TestConn" connectionString="Data Source=Server1;Initial Catalog=CatalogName;User ID=UserID;Password=Password" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"></add>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"></add>
</assemblies>
</compilation>
<authentication mode="Windows"/>
<customErrors mode="Off"/>
<httpModules></httpModules>
<pages>
<controls>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="cc1" />
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
</system.web>
</configuration>
Many Thanks in advance.
Regards
Betty
You are adding the System.Web.Extensions section twice:
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls"
assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Remove one of them.
After you do that, you'll probably have some compilation errors. Just adjust the using statements to point to the appropriate namespace.
I'm having issues getting UpdatePanel working in a large, existing solution. I have a sample page (below), which works in a freshly created demo website, but not when added to the existing target website.
The functionality is to isolate a dropdown's auto-postback, so I don't lose the contents of a FileUpload ASP control (it does this for security reasons, with some solutions described here)
In the target (non-demo) site, the control adds to the page fine (inc intellisense), and the page renders - but changing the drop down still performs a postback, rather than ajax-ifying the dropdown box.
The target solution mentioned was previously upgraded from ASP.NET v1.1, so I'm wondering if there's something I'm missing in the configuration?
The only difference I can find in the rendered HTML source is that the non-working version doesn't add the PageRequestManager, e.g.:
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl02', document.getElementById('form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl03'], [], [], 90);
//]]>
</script>
Sample page:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager2" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:DropDownList runat="server" ID="TestDropDown" AutoPostBack="true" OnSelectedIndexChanged="TestDropDown_SelectedIndexChanged">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
<asp:ListItem>Three</asp:ListItem>
</asp:DropDownList>
<asp:Literal runat="server" Text="Original state" ID="litText" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:FileUpload ID="FileUpload2" runat="server" />
</div>
</form>
</body>
</html>
And in the code behind:
protected void TestDropDown_SelectedIndexChanged(object sender, EventArgs e)
{
litText.Text = "Ajax update. The file details should still be present below";
}
I can confirm that the ScriptManager tag adds the following to the page source, so I assume the Ajax Toolkit has been added:
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
And that we have the following sections in web.config:
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
[...]
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, [...]
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions" [...]
[...]
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
The sample works in the demo site without the <Triggers> section, but I've tried adding it to the target site, to no avail.
Turns out the following should not be set in web.config, and occurs as a result of the upgrade from ASP.NET v1.1:
<xhtmlConformance mode="Legacy"/>
As discussed on ScottGu's blog post
I am attempting to register my user controls within the webconfig file because I am receiving the Element does not exist error, but I am receiving the following error when I try to register them in webconfig:
Invalid or missing attributes found in the tagPrefix entry. For user control, you must also specify 'tagName' and 'src'. For custom control, you must also specify 'namespace', and optionally 'assembly'
The following is the code within the webconfig file:
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="IPAMControl" tagName="contact_us" namespace="IPAM.Website.Controls" src="~/controls/contact_us.ascx" />
<add tagPrefix="IPAMControl" tagName="erh_list" namespace="IPAM.Website.Controls" src="~/controls/erh_list.ascx" />
<add tagPrefix="IPAMControl" tagName="header" namespace="IPAM.Website.Controls" src="~/controls/header.ascx" />
<add tagPrefix="IPAMControl" tagName="footer" namespace="IPAM.Website.Controls" src="~/controls/footer.ascx" />
<add tagPrefix="IPAMControl" tagName="main_tnavbar" namespace="IPAM.Website.Controls" src="~/controls/main_tnavbar.ascx" />
<add tagPrefix="IPAMControl" tagName="program_header" namespace="IPAM.Website.Controls" src="~/controls/program_header.ascx" />
<add tagPrefix="IPAMControl" tagName="program_list" namespace="IPAM.Website.Controls" src="~/controls/program_list.ascx" />
<add tagPrefix="IPAMControl" tagName="signup_section" namespace="IPAM.Website.Controls" src="~/controls/signup_section.ascx" />
<add tagPrefix="IPAMControl" tagName="speaker_list" namespace="IPAM.Website.Controls" src="~/controls/speaker_list.ascx" />
<add tagPrefix="IPAMControl" tagName="track" namespace="IPAM.Website.Controls" src="~/controls/track.ascx" />
</controls>
</pages>
The pages that are having this issue are also referencing MasterPages if that matters at all:
<%# Page Language="C#" AutoEventWireup="true" MasterPageFile="~/programs/MasterProgram.master" CodeBehind="~/programs/wim2011/default.aspx" Inherits="IPAM.Website.programs.wim2011._default" %>
and they are each within their own folders.
Please help.
Get rid of the namespace attribute, as it's confusing ASP.NET as to whether you're attempting to register a User Control or a Custom Control.
User Control:
<add tagPrefix="SomeTagPrefix" src="~/Controls/SomeControl.ascx" tagName="SomeTagName"/>
Custom Control:
<add tagPrefix="SomeTagPrefix" namespace="SomeNamespace" assembly="SomeAssembly"/>
So, in your example:
<add tagPrefix="IPAMControl" tagName="track" src="~/controls/track.ascx" />
And on the ASPX/ASCX, you use it like this:
<IPAMControl:track id="ipamTrack" runat="server" />
See here for more info.
EDIT
To prove this works - i did the following:
Create new Web Application
Create new folder called "Controls" in the root of the web application
Added a new "Web User Control" called "MyUserControl.ascx"
Modified web.config to add registration of control
Modified Default.aspx to add the control.
And it all works fine.
Here is the User Control:
<%# Control Language="C#" AutoEventWireup="true" CodeBehind="MyUserControl.ascx.cs" Inherits="WebApplication1.Controls.MyUserControl" %>
<span>Hi, im a user control, how are you?</span>
Here is the portion of the web.config i edited:
<pages>
<controls>
<add tagPrefix="MyControls" tagName="MyUserControl" src="~/Controls/MyUserControl.ascx"/>
</controls>
</pages>
Here is the Default.aspx change i made:
<MyControls:MyUserControl id="myUserControl" runat="server" />
And the page rendered correctly.
Now, unless what i have done here is different to how you have attempting to do it, you must have other code/errors that is interfering with this.
Don't know how much else help i can be.