473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error Loading UserControl

I am revieving the following error for one of my controls when loading any
pages that use it:

Server Error in '/exposure/app' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not load type 'AFBE.titlebanner'.

Source Error:

Line 1: <%@ Control Language="vb" AutoEventWireup="false"
CodeBehind="titlebanner.ascx.vb" Inherits="AFBE.titlebanner" %>
Line 2: <table border="0" cellpadding="0" cellspacing="0" width="100%">
Line 3: <tr>

Source File: D:\WWWRoot\afbeorg\www\exposure\app\titlebanner.as cx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
The UserControl and the pages that use it are in the same directory. Here
are the lines I use to register and use the control in the *.aspx file (the
registration line is the first line in the *.aspx file, and it is used
immediately after the <form id="form1" runat="server"tag):

<%@ Register TagPrefix="afbe" TagName="titlebanner" Src="titlebanner.ascx"
%>
<afbe:titlebanner id="titlebanner1" runat="server"></afbe:titlebanner>

The usercontrol itself is just an HTML table that contains 2 imagemaps. What
could be the problem? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 7 '06 #1
1 1117
Without seeing your codefile, I'm first curious to your Inherits property.
>Inherits="AFBE.titlebanner"
I'm assuming that your class is called either AFBE or titlebanner, not AFBE.titlebanner.
As far as I know, you cannot reference a class underneath the control's
UserControl inherited class (the myControl class in the example below).

For a simplistic example, if I have a control called myControl that returns
a simple text box:

myControl.ascx
--
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="myControl.ascx.cs"
Inherits="myControl" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
--

myControl.ascx.cs
--
using System;

public partial class myControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Text = "Hello there, this is a test!";
}
}
--
This control is then called on my web page via, Default.aspx, by the following:
--
<%@ Register Src="~/myControl.ascx" TagPrefix="DRL" TagName="myControl" %>
....
....
<form id="form1" runat="server">
<div>
<DRL:myControl runat="server" ID="mynewcontrol" />
</div>
</form>
--

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com
I am revieving the following error for one of my controls when loading
any pages that use it:

Server Error in '/exposure/app' Application.
----------------------------------------------------------------------
----------
Parser Error
Description: An error occurred during the parsing of a resource
required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type 'AFBE.titlebanner'.

Source Error:

Line 1: <%@ Control Language="vb" AutoEventWireup="false"
CodeBehind="titlebanner.ascx.vb" Inherits="AFBE.titlebanner" %>
Line 2: <table border="0" cellpadding="0" cellspacing="0"
width="100%">
Line 3: <tr>
Source File: D:\WWWRoot\afbeorg\www\exposure\app\titlebanner.as cx
Line: 1

----------------------------------------------------------------------
---------- Version Information: Microsoft .NET Framework
Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

The UserControl and the pages that use it are in the same directory.
Here are the lines I use to register and use the control in the *.aspx
file (the registration line is the first line in the *.aspx file, and
it is used immediately after the <form id="form1" runat="server">
tag):

<%@ Register TagPrefix="afbe" TagName="titlebanner"
Src="titlebanner.ascx"
%>
<afbe:titlebanner id="titlebanner1" runat="server"></afbe:titlebanner>
The usercontrol itself is just an HTML table that contains 2
imagemaps. What could be the problem? Thanks.


Nov 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John | last post by:
Hi all, I'm having a little problem understanding the concepts of dynamically loading/unloading user conrols: 1. If I have a couple of usercontrols embedded within a few tables cells on my...
1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
1
by: Sundaresan | last post by:
I've a form where I load two user controls dynamically. User Control-1 has a no.of dropdowns and based on the selection I typically populate a datagrid in the user control-2, Also the I could...
0
by: Phl | last post by:
Hi, I am trying to create an webform which loads usercontrols dyanamically. I know exactly what to load for some of these controls but for some, I dont want to load it until the user has press a...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
4
by: Tim B | last post by:
Hi, Previously I was loading my .NET Usercontrol like this : <OBJECT id="Obj" classid="Viewer.dll#Viewer.Viewer" width=105 height=20 VIEWASTEXT><param name="DONOTHING" value="1"> </OBJECT> ...
1
by: Nathan Sokalski | last post by:
I am revieving the following error for one of my controls when loading any pages that use it: Server Error in '/exposure/app' Application....
1
by: Frank | last post by:
Every once in a while I'll close VS2005 with a UserControl (that contains another UserControl) open in the designer. Then when I open VS2005 the next time the designer window will display a...
2
by: acadam | last post by:
In my application I have a usercontrol called "base" with a panel called "pnl1"; in "pnl1" I put my usercontrol. Now I would like to have 2 possibilities: from "base" to load another control...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.