Howto reference non-webcontrols on an ASPX page?

Discussion in 'ASP .Net Building Controls' started by Gergely Varadi, Sep 22, 2003.

  1. Like the <asp:ListBox> and <asp:ListItem> pair, my control use item
    definitions, just they are in another assembly:

    <mycontrollib:myctrl1>
    <Params>
    <myitemlib:myitem someattr="someval1">
    some text1
    </myitemlib:myitem>
    <myitemlib:myitem someattr="someval2">
    some text2
    </myitemlib:myitem>
    </Params>
    </mycontrollib:myctrl1>

    When I drag the control on the page, all the dependencies will be
    referenced under the "References" node, but the page will contain <@
    Register TagPrefix...> only for 'mycontrollib'.

    So Visual Studio throws an exception because it cannot find
    'myitemlib'.

    2nd problem
    -----------

    Inserting manually <@ Register TagPrefix...> for 'myitemlib' and
    editing the 'Params' collection with the default collection editor, it
    puts

    <myitemlib.myitem someattr="someval1">...

    instead of

    <myitemlib:myitem someattr="someval1">...

    (Use of period instead of colon.)

    Code
    ----

    In 'mycontrollib.dll':

    public class myctrl1 : WebControl
    {
    [PersistenceMode(PersistenceMode.InnerProperty]
    public MyItemColl Params
    {...}
    }

    In 'myitemlib.dll':

    public class MyItemColl : CollectionBase
    {
    public int Add(MyItem item)
    {...}
    public MyItem this[int Index]
    {...}
    }

    public class MyItem : IParserAccessor, IComparable
    {
    ....
    }
     
    Gergely Varadi, Sep 22, 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. Andreas Klemt

    HowTo loop through HTML Table WebControls?

    Andreas Klemt, Aug 22, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    12,632
    Ken Cox [Microsoft MVP]
    Aug 22, 2003
  2. Alain Sienaert

    Reference Delphi aspx page in VB.aspx

    Alain Sienaert, Jul 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    518
    Eliyahu Goldin
    Jul 22, 2004
  3. Don Wash
    Replies:
    2
    Views:
    4,768
    Don Wash
    Sep 7, 2004
  4. Les Caudle
    Replies:
    1
    Views:
    346
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
  5. brown

    create webcontrols in aspx or aspx.cs

    brown, Sep 22, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    171
    brown
    Sep 24, 2006
Loading...

Share This Page