Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Error Loading UserControl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Sokalski - 07 Nov 2006 22:54 GMT
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.ascx    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.
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

David Longnecker - 08 Nov 2006 15:03 GMT
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:
[quoted text clipped - 35 lines]
> The usercontrol itself is just an HTML table that contains 2
> imagemaps. What could be the problem? Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.