Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Server control with property that references to another library

Reply
Thread Tools

Server control with property that references to another library

 
 
Petr PALAS
Guest
Posts: n/a
 
      07-08-2004
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!
************************************************** **************************
****


 
Reply With Quote
 
 
 
 
S.Grevi
Guest
Posts: n/a
 
      07-08-2004
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.


 
Reply With Quote
 
 
 
 
Petr PALAS
Guest
Posts: n/a
 
      07-08-2004
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.
>
>



 
Reply With Quote
 
S.Grevi
Guest
Posts: n/a
 
      07-09-2004
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
>
>



 
Reply With Quote
 
Petr PALAS
Guest
Posts: n/a
 
      07-09-2004
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
> >
> >

>
>



 
Reply With Quote
 
S.Grevi
Guest
Posts: n/a
 
      07-09-2004
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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Petr PALAS
Guest
Posts: n/a
 
      07-09-2004
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
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
S.Grevi
Guest
Posts: n/a
 
      07-09-2004
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.


 
Reply With Quote
 
Petr PALAS
Guest
Posts: n/a
 
      07-09-2004
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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
How could I change the NavigateUrl property at runtime based on another controls property ? Radu ASP .Net 2 01-25-2007 10:51 AM
User-control with property accessors == null references Mark ASP .Net 2 08-03-2006 09:19 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM



Advertisments
 



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