Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Adding a Register directive to an aspx page programmatically

Reply
Thread Tools

Adding a Register directive to an aspx page programmatically

 
 
Arnaud PICHERY
Guest
Posts: n/a
 
      11-16-2003
Hi !

I am reposting the following question as it went under another topic (don't
know exactly why)

I have a design-time problem that puzzle me...
I am building a WebControls library and one of the control inherits from
Chart which is located in the DundasWebChart WebControls library.
When I adds a legend to this charting control its serialized form is similar
to something like this:
<myCompany:Chart runat=server ...>
<Legend>
<dcwc:LegendText ... />
</Legend>
</myCompany>

"myCompany" is the TagPrefix of my WebControls library, and "dcwc" the
TagPrefix of DundasWebChart.
The problem is that when I drag'n'drop my control from the ToolBox, Visual
Studio .NET only adds one Register directive, the one
for my WebControls library.
<%@ Register TagPrefix="myCompany" Namespace="MyCompany.WebControls"
Assembly="MyCompany.WebControls" %>

But I definitely need the Register directive for the Dundas WebControls
library in order for my control to work (both at design-time
and runtime).
The question is: Is there a way for me to add the Register directive for the
Dundas WebControls library programmatically? Inside the
ControlDesigner.OnSetParent method for example?
I know how to retrieve the registered directives using
IWebFormReferenceManager.GetDirectives() but can't find a way to add a
directive.

In the same way, is there a way to access and modify to the content of the
aspx file at design-time?..To add a Register Directive for example...:O)

Thanks in advance,
Arnaud :O)




 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      11-18-2003
Not adding to an aspx page, but when using Page.ParseControl to parse a
control from declarative syntax (say string variable), one can provide a
register directive for the parsing process (along with the markup to be
parsed).

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"jline" <> wrote in message
news rter.net...
> I don't think that the functionality you are looking
> for exists. Anybody here who would like to post a solution
> and prove me wrong?
>
> You could try proxying the functionality of the other
> library through your own by inheriting proxy objects in you library
> from the other libraries objects and designers (Make sure
> to set new Designer() attributes for the inherited versions.)
> If you use relatively few of the other libraries classes
> from your own this approach will probably work ok.
>
> Good Luck,
> John
>
> On Sun, 16 Nov 2003 23:40:57 +0100, Arnaud PICHERY wrote:
>
> > Hi !
> >
> > I am reposting the following question as it went under another topic

(don't
> > know exactly why)
> >
> > I have a design-time problem that puzzle me...
> > I am building a WebControls library and one of the control inherits from
> > Chart which is located in the DundasWebChart WebControls library.
> > When I adds a legend to this charting control its serialized form is

similar
> > to something like this:
> > <myCompany:Chart runat=server ...>
> > <Legend>
> > <dcwc:LegendText ... />
> > </Legend>
> > </myCompany>
> >
> > "myCompany" is the TagPrefix of my WebControls library, and "dcwc" the
> > TagPrefix of DundasWebChart.
> > The problem is that when I drag'n'drop my control from the ToolBox,

Visual
> > Studio .NET only adds one Register directive, the one
> > for my WebControls library.
> > <%@ Register TagPrefix="myCompany" Namespace="MyCompany.WebControls"
> > Assembly="MyCompany.WebControls" %>
> >
> > But I definitely need the Register directive for the Dundas WebControls
> > library in order for my control to work (both at design-time
> > and runtime).
> > The question is: Is there a way for me to add the Register directive for

the
> > Dundas WebControls library programmatically? Inside the
> > ControlDesigner.OnSetParent method for example?
> > I know how to retrieve the registered directives using
> > IWebFormReferenceManager.GetDirectives() but can't find a way to add a
> > directive.
> >
> > In the same way, is there a way to access and modify to the content of

the
> > aspx file at design-time?..To add a Register Directive for example...:O)
> >
> > Thanks in advance,
> > Arnaud :O)

>



 
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 adding a reference via Register directive leeanne ASP .Net 0 02-10-2009 09:45 PM
HELP! - "The WSIntranet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24410d33c1a2222e assembly specified in a Register directive of this page could not be found" Mike ASP .Net Security 0 07-30-2004 02:08 PM
Problem with runtime compilation of aspx files. Register Directive ignores Assembly Dan ASP .Net 3 06-14-2004 06:13 AM
The 'Location' attribute is not supported by the 'OutPutCache' directive????when i set in the directive .NET Follower ASP .Net 1 02-13-2004 10:32 AM
How I can I add a Register directive programmatically to an aspx page from a ControlDesigner? Arnaud PICHERY ASP .Net Web Controls 0 11-14-2003 10:57 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