How I can I add a Register directive programmatically to an aspx page from a ControlDesigner?

Discussion in 'ASP .Net Web Controls' started by Arnaud PICHERY, Nov 14, 2003.

  1. Hi !

    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 14, 2003
    #1
    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. Sergey Polyakov
    Replies:
    0
    Views:
    410
    Sergey Polyakov
    May 24, 2004
  2. Dan
    Replies:
    3
    Views:
    644
    =?Utf-8?B?RGFu?=
    Jun 14, 2004
  3. Leo Muller
    Replies:
    1
    Views:
    525
    Karl Seguin
    Nov 14, 2004
  4. =?Utf-8?B?UGF1bCBQcmV3ZXR0?=

    Null Reference Exception on @Register Directive

    =?Utf-8?B?UGF1bCBQcmV3ZXR0?=, Sep 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    321
    =?Utf-8?B?UGF1bCBQcmV3ZXR0?=
    Sep 27, 2006
  5. Arnaud PICHERY

    Adding a Register directive to an aspx page programmatically

    Arnaud PICHERY, Nov 16, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    412
    Teemu Keiski
    Nov 18, 2003
Loading...

Share This Page