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

  1. #1

    Default Parser Error

    Hi,

    I have a custom control, defined in the file LinkLabel.cs, compiled into
    assembly MyControl.dll

    namespace MyControl
    {
    [DefaultProperty("Text"), ToolboxData("<{0}:LinkLabel
    runat=server></{0}:LinkLabel>")]
    public class LinkLabel : Label
    {
    …..
    }
    .....
    }
    The control’s dll is in a bin directory of the web page, which will use it.

    In my “asp” page I registered control:
    <%@ Register TagPrefix="mspo" Namespace="MyControl" Assembly="MyControl" %>

    and used the control:
    <mspo:LinkLabel id="LinkLabel1" runat="server" ></mspo:LinkLabel>

    In code behind:
    protected MyControl.LinkLabel LinkLabel1;
    …..
    LinkLabel1.Text = "blablabla";

    I can compile my web page with no error, however, when I run it, I get a
    parser error:

    Parser Error Message: The base class includes the field 'LinkLabel1', but
    its type (MyControl.LinkLabel) is not compatible with the type of control
    (MyControl.LinkLabel).

    Source error line:
    <mspo:LinkLabel id="LinkLabel1" runat="server" ></mspo:LinkLabel>

    Please note, that the types mentioned in Parser Error Message are identical.
    When I change the definition of a control object in codebehind class
    from
    protected MyControl.LinkLabel LinkLabel1;

    To
    protected Label LinkLabel1; // Label is the base class for LinkLabel

    everything is good.

    What is wrong with the parser when I use inherited, LinkLabel class?

    Thanks for a help.

    Lubomir

    Lubomir Guest

  2. Similar Questions and Discussions

    1. need help on parser error
      hi, I've a problem in accessing user controls when I deploy the application in the production server.. I'm receiving the following error... ...
    2. HTML::Parser error
      I recently installed PERL on my system but am having a problem with the parser.pm file. Whenever I try to run a script the following error shows...
    3. Parser Error: Type XYZ does not have a property named 'cc3:MyItems' (complete posting) ASP.NET Web Control Error
      I am having problems trying to get this part of the functionality working on my control and I hope somebody has a clue about how to resolve it. ...
    4. Error Creating Control: Parser Error DocHeader does not have a property named 'cc3:MyItems'
      I am having problems getting this webcontrol working properly. Everything else works fine except having items. So here is the low-down on the...
    5. Parser Error - still...
      I'm getting Parser Error, Could not load type 'namespace.class'. I'm only getting this error when I try and open a frameset. I can open the...
  3. #2

    Default RE: Parser Error

    "Lubomir" wrote:
    > I have a custom control, defined in the file LinkLabel.cs, compiled into
    > assembly MyControl.dll
    >
    > The control’s dll is in a bin directory of the web page, which will use it.
    >
    > I can compile my web page with no error, however, when I run it, I get a
    > parser error:
    >
    > Parser Error Message: The base class includes the field 'LinkLabel1', but
    > its type (MyControl.LinkLabel) is not compatible with the type of control
    > (MyControl.LinkLabel).
    >
    > Please note, that the types mentioned in Parser Error Message are identical.
    Are you referencing the same assembly at compile time to that being used at
    runtime?
    Rowland Shaw Guest

  4. #3

    Default Parser error

    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: The located assembly's manifest definition with name
    'Microsoft.Web.UI.WebControls' does not match the assembly reference.

    Source Error:


    Line 5:
    Line 6: <%@ Register tagprefix ="BTL" assembly="CustomControl"
    NameSpace="BTLIntraPageDesignLayout" %>
    Line 7: <%@ Register TagPrefix="IE"
    Namespace="Microsoft.Web.UI.WebControls"
    Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35" %>
    Line 8:
    Line 9:

    Help needed.

    Thanks.
    Sandy

    sandy 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