Error Loading UserControl

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default 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
    [email]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]


    Nathan Sokalski Guest

  2. Similar Questions and Discussions

    1. Event not firing in usercontrol inside usercontrol
      I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these...
    2. Loading UserControl in ASP.NET...
      Is it possible to create a UserControl or Windows Form within a WebForm? What I wanted to do is to create a stand-alone .NET Windows Form...
    3. Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
      a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use...
    4. Repost : Usercontrol loading and once-off processing
      Set a viewstate for the control that tells whether is has been posted back on. in your user control: void Page_Load(...) { if ( ViewState ==...
    5. Usercontrol loading question
      Hi all, How does a user control differentiate between the first time it has been loaded into a page and subsequent times? I have a situation...
  3. #2

    Default Re: Error Loading UserControl

    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
    [url]http://blog.tiredstudent.com[/url]
    > 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.
    >


    David Longnecker Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139