Server control with property that references to another library

Discussion in 'ASP .Net Web Controls' started by Petr PALAS, Jul 8, 2004.

  1. Petr PALAS

    Petr PALAS Guest

    Hi,

    I'm trying to create a server control (in namespace and library
    Kentico.CMS.CMSControls) for ASP.NET 1.1 that has a property of type
    GeneralConnection. This type is defined in another library
    ("Kentico.CMS.DataEngine.dll") and namespace ("Kentico.CMS.DataEngine").

    When I drag and drop the control on the Web form, I get the following error
    message:
    Error Creating Control
    Parse Error: File or assembly name X, or one of its dependencies, was not
    found.

    The Kentico.CMS.DataEngine.dll libary is referenced in my project and the
    page contains the TagPrefix directive for the control itself.

    When I add the following additional directive to the ASPX page, everything
    works fine:
    <%@ Register TagPrefix="cc2" Namespace="Kentico.CMS.DataEngine"
    Assembly="Kentico.CMS.DataEngine.dll" %>

    However, is there any simple solution, so that the developer doesn't have to
    add the additional TagPrefix directive?

    Thank you.

    Best Regards,

    Petr Palas

    ****************************************************************************
    ****
    Kentico Software
    WWW: http://www.kentico.com
    Blog: http://www.kentico.com/blog
    Kentico CMS - The most affordable CMS for ASP.NET professionals. Sign up for
    beta NOW!
    ****************************************************************************
    ****
    Petr PALAS, Jul 8, 2004
    #1
    1. Advertising

  2. Petr PALAS

    S.Grevi Guest

    It's only my very humble opinion but...

    When you write the stated tag prefix you are REFERENCING the library
    Kentico.CMS.DataEngine for this page only.

    Try to reference the library at project (-web project-) level...

    Or I didn't get the point...

    Stefano G.
    S.Grevi, Jul 8, 2004
    #2
    1. Advertising

  3. Petr PALAS

    Petr PALAS Guest

    Thanks for reply. I have the library referenced at the project level, but it
    seems it's not enough.

    Petr



    "S.Grevi" <> wrote in message
    news:...
    > It's only my very humble opinion but...
    >
    > When you write the stated tag prefix you are REFERENCING the library
    > Kentico.CMS.DataEngine for this page only.
    >
    > Try to reference the library at project (-web project-) level...
    >
    > Or I didn't get the point...
    >
    > Stefano G.
    >
    >
    Petr PALAS, Jul 8, 2004
    #3
  4. Petr PALAS

    S.Grevi Guest

    Let me organize the scenario :

    1st Library : Kentico.CMS.DataEngine
    2nd Library : Kentico.CMS.CMSControls using Kentico.CMS.DataEngine
    Client : Web Form using Kentico.CMS.CMSControls

    It's correct, Petr ?

    Stefano G.

    "Petr PALAS" <> wrote in message
    news:...
    > Thanks for reply. I have the library referenced at the project level, but

    it
    > seems it's not enough.
    >
    > Petr
    >
    >
    S.Grevi, Jul 9, 2004
    #4
  5. Petr PALAS

    Petr PALAS Guest

    Yes, it's correct.

    Thank you in advance for any answer.

    Regards,

    Petr

    "S.Grevi" <> wrote in message
    news:...
    > Let me organize the scenario :
    >
    > 1st Library : Kentico.CMS.DataEngine
    > 2nd Library : Kentico.CMS.CMSControls using Kentico.CMS.DataEngine
    > Client : Web Form using Kentico.CMS.CMSControls
    >
    > It's correct, Petr ?
    >
    > Stefano G.
    >
    > "Petr PALAS" <> wrote in message
    > news:...
    > > Thanks for reply. I have the library referenced at the project level,

    but
    > it
    > > seems it's not enough.
    > >
    > > Petr
    > >
    > >

    >
    >
    Petr PALAS, Jul 9, 2004
    #5
  6. Petr PALAS

    S.Grevi Guest

    You are welcome Petr, even if I don't have right now a 'solution' for this.

    I think, however, that the reference chain is broken when you are trying to
    put the control in the web form.
    It's strange that the reference to the control is correctly managed but the
    '2nd level' reference is not.

    I'll try to search some 'inspiration' on this, in the meantime, if you are
    using VS2003, could you try to put your custom control
    in the toolbox and then put it on the page.

    To be sure that it's all ok, see this article :
    http://www.15seconds.com/issue/020430.htm

    Could happen that, with this 'workaround' every reference is maintained...

    Stefano G.


    "Petr PALAS" <> wrote in message
    news:%...
    > Yes, it's correct.
    >
    > Thank you in advance for any answer.
    >
    > Regards,
    >
    > Petr
    >
    > "S.Grevi" <> wrote in message
    > news:...
    > > Let me organize the scenario :
    > >
    > > 1st Library : Kentico.CMS.DataEngine
    > > 2nd Library : Kentico.CMS.CMSControls using Kentico.CMS.DataEngine
    > > Client : Web Form using Kentico.CMS.CMSControls
    > >
    > > It's correct, Petr ?
    > >
    > > Stefano G.
    > >
    > > "Petr PALAS" <> wrote in message
    > > news:...
    > > > Thanks for reply. I have the library referenced at the project level,

    > but
    > > it
    > > > seems it's not enough.
    > > >
    > > > Petr
    > > >
    > > >

    > >
    > >

    >
    >
    S.Grevi, Jul 9, 2004
    #6
  7. Petr PALAS

    Petr PALAS Guest

    Thanks, Stefano. I'm already using the VS2003 Toolbox.

    Regards,

    Petr




    "S.Grevi" <> wrote in message
    news:%...
    > You are welcome Petr, even if I don't have right now a 'solution' for

    this.
    >
    > I think, however, that the reference chain is broken when you are trying

    to
    > put the control in the web form.
    > It's strange that the reference to the control is correctly managed but

    the
    > '2nd level' reference is not.
    >
    > I'll try to search some 'inspiration' on this, in the meantime, if you are
    > using VS2003, could you try to put your custom control
    > in the toolbox and then put it on the page.
    >
    > To be sure that it's all ok, see this article :
    > http://www.15seconds.com/issue/020430.htm
    >
    > Could happen that, with this 'workaround' every reference is maintained...
    >
    > Stefano G.
    >
    >
    > "Petr PALAS" <> wrote in message
    > news:%...
    > > Yes, it's correct.
    > >
    > > Thank you in advance for any answer.
    > >
    > > Regards,
    > >
    > > Petr
    > >
    > > "S.Grevi" <> wrote in message
    > > news:...
    > > > Let me organize the scenario :
    > > >
    > > > 1st Library : Kentico.CMS.DataEngine
    > > > 2nd Library : Kentico.CMS.CMSControls using Kentico.CMS.DataEngine
    > > > Client : Web Form using Kentico.CMS.CMSControls
    > > >
    > > > It's correct, Petr ?
    > > >
    > > > Stefano G.
    > > >
    > > > "Petr PALAS" <> wrote in message
    > > > news:...
    > > > > Thanks for reply. I have the library referenced at the project

    level,
    > > but
    > > > it
    > > > > seems it's not enough.
    > > > >
    > > > > Petr
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Petr PALAS, Jul 9, 2004
    #7
  8. Petr PALAS

    S.Grevi Guest

    I've found something on MSDN telling the use of the TagPrefix Attribute in
    the Custom Control Creation, but in our case I think you cannot afford to
    put a
    'using System.Web.UI' in the assembly of the Kentico.CMS.DataEngine to
    maintain the general usability of this dll even in non-web applications.

    So... i'm looking for a solution, it's an interesting matter :)

    This is the chunk of MSDN I've found :

    To change the tag prefix
    Under the CustomLabel project in Solution Explorer, double-click
    AssemblyInfo to open the AssemblyInfo file in the designer. Add an Imports
    statement (in Visual Basic) or using statement (in Visual C#) at the top of
    the AssemblyInfo page:
    ' Visual Basic
    Imports System.Web.UI

    // C#
    using System.Web.UI;
    Add an Assembly: TagPrefix attribute to the list of assembly attributes.
    This will specify the new TagPrefix for the CustomLabel control, in this
    case xxx.
    ' Visual Basic
    <Assembly: TagPrefix("CustomLabel", "xxx")>

    //C#
    [assembly: TagPrefix("CustomLabel", "xxx")]

    This suggest that you put the 'using' and the TagPrefix line in the
    dataEngine dll...that's crazy IMHO !

    Stefano G.
    S.Grevi, Jul 9, 2004
    #8
  9. Petr PALAS

    Petr PALAS Guest

    Hi Stefano,

    thank you for your message. Unfortunately, this is something I already tried
    before and it didn't help :( Anyway, it seems to be an anomaly, since
    another developer wrote me that he has a similar control and it works...

    Regards,

    Petr



    "S.Grevi" <> wrote in message
    news:...
    > I've found something on MSDN telling the use of the TagPrefix Attribute in
    > the Custom Control Creation, but in our case I think you cannot afford to
    > put a
    > 'using System.Web.UI' in the assembly of the Kentico.CMS.DataEngine to
    > maintain the general usability of this dll even in non-web applications.
    >
    > So... i'm looking for a solution, it's an interesting matter :)
    >
    > This is the chunk of MSDN I've found :
    >
    > To change the tag prefix
    > Under the CustomLabel project in Solution Explorer, double-click
    > AssemblyInfo to open the AssemblyInfo file in the designer. Add an Imports
    > statement (in Visual Basic) or using statement (in Visual C#) at the top

    of
    > the AssemblyInfo page:
    > ' Visual Basic
    > Imports System.Web.UI
    >
    > // C#
    > using System.Web.UI;
    > Add an Assembly: TagPrefix attribute to the list of assembly attributes.
    > This will specify the new TagPrefix for the CustomLabel control, in this
    > case xxx.
    > ' Visual Basic
    > <Assembly: TagPrefix("CustomLabel", "xxx")>
    >
    > //C#
    > [assembly: TagPrefix("CustomLabel", "xxx")]
    >
    > This suggest that you put the 'using' and the TagPrefix line in the
    > dataEngine dll...that's crazy IMHO !
    >
    > Stefano G.
    >
    >
    Petr PALAS, Jul 9, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Beall
    Replies:
    1
    Views:
    419
    Bertilo Wennergren
    Dec 10, 2003
  2. Noozer
    Replies:
    10
    Views:
    2,068
    Mitja
    Oct 13, 2004
  3. Mark
    Replies:
    2
    Views:
    660
  4. Radu
    Replies:
    2
    Views:
    1,320
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Jan 25, 2007
  5. Sean

    Collection Property of Another Custom Server Control

    Sean, Jan 11, 2006, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    130
Loading...

Share This Page