Adding a Register directive to an aspx page programmatically

Discussion in 'ASP .Net Building Controls' started by Arnaud PICHERY, Nov 16, 2003.

  1. 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)
     
    Arnaud PICHERY, Nov 16, 2003
    #1
    1. Advertising

  2. Arnaud PICHERY

    Teemu Keiski Guest

    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:p...
    > 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)

    >
     
    Teemu Keiski, Nov 18, 2003
    #2
    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. Dan
    Replies:
    3
    Views:
    631
    =?Utf-8?B?RGFu?=
    Jun 14, 2004
  2. Leo Muller
    Replies:
    1
    Views:
    517
    Karl Seguin
    Nov 14, 2004
  3. John M
    Replies:
    1
    Views:
    1,256
    Kumar Reddi
    May 29, 2005
  4. leeanne
    Replies:
    0
    Views:
    406
    leeanne
    Feb 10, 2009
  5. Arnaud PICHERY
    Replies:
    0
    Views:
    165
    Arnaud PICHERY
    Nov 14, 2003
Loading...

Share This Page