Custom control is naming it's components differently

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Custom control is naming it's components differently

    I have written a custom control that uses AJAX (it implements
    IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it
    seems to work the way I want. However, when I used it in another application
    of mine it named the components as ControlID$ComponentID instead of
    ControlID:ComponentID. I did not change any of the code, so obviously
    something else is making this happen. I need to have it name the components
    using ControlID:ComponentID so that my code works. What might be causing
    this different naming method? Thanks.
    --
    Nathan Sokalski
    [email]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]


    Nathan Sokalski Guest

  2. Similar Questions and Discussions

    1. Naming Custom Page Sizes in Acrobat 6.0.3 under Tiger 10.4.2
      When creating custom page sizes in Acrobat the new option inside page setup "Manage Custom Sizes" seems to work but as i add a new size the name...
    2. Custom Components
      I've built some flash MX components for use by my team. I'd like to know how to make the component update on the stage at design-time when the...
    3. custom components tutorials?
      hey, i'm new here and i'm fairly new to flash too... i was wondering if anyone knew of a decent tutorial for making custom components......
    4. ControlDesigner not invoked on custom control when control is rendered within another custom control
      I have a custom control that has a simple designer (derived from System.Web.UI.Design.ControlDesigner) associated with it (using the...
    5. Using Table control in a custom composite control. Control does not render properly in design time.
      All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control...
  3. #2

    Default Re: Custom control is naming it's components differently

    I don't know the cause of your problem, but I suggest that you don't try to
    predict the ID's of your controls, since the naming system may change in
    future versions of ASP.NET.

    Instead, use MyControl.ClientID to get the real ID of your controls.

    --

    Riki

    "Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
    news:evSAKN5LHHA.320@TK2MSFTNGP06.phx.gbl...
    >I have written a custom control that uses AJAX (it implements
    >IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it
    >seems to work the way I want. However, when I used it in another
    >application of mine it named the components as ControlID$ComponentID
    >instead of ControlID:ComponentID. I did not change any of the code, so
    >obviously something else is making this happen. I need to have it name the
    >components using ControlID:ComponentID so that my code works. What might be
    >causing this different naming method? Thanks.
    > --
    > Nathan Sokalski
    > [email]njsokalski@hotmail.com[/email]
    > [url]http://www.nathansokalski.com/[/url]
    >

    Riki Guest

  4. #3

    Default Re: Custom control is naming it's components differently

    That would work, except for one small problem: I'm not talking about the id.
    When using AJAX, the IPostBackDataHandler interface is implemented, which
    contains a function called LoadPostData. This function has parameters called
    postDataKey and postCollection. To access the values of the different
    components, you use postCollection(postDataKey & "$ddlYear"). The expression
    postDataKey & "$ddlYear" evaluates to the client name, not the client id. I
    do not know of a property or function that returns the client name, so this
    is the only method I know of to get the component values, and it is also how
    I have seen it done by other people. Any ideas? Thanks.
    --
    Nathan Sokalski
    [email]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]

    "Riki" <riki@bounce.com> wrote in message
    news:O1HJvr%23LHHA.3952@TK2MSFTNGP02.phx.gbl...
    >I don't know the cause of your problem, but I suggest that you don't try to
    >predict the ID's of your controls, since the naming system may change in
    >future versions of ASP.NET.
    >
    > Instead, use MyControl.ClientID to get the real ID of your controls.
    >
    > --
    >
    > Riki
    >
    > "Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
    > news:evSAKN5LHHA.320@TK2MSFTNGP06.phx.gbl...
    >>I have written a custom control that uses AJAX (it implements
    >>IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it
    >>seems to work the way I want. However, when I used it in another
    >>application of mine it named the components as ControlID$ComponentID
    >>instead of ControlID:ComponentID. I did not change any of the code, so
    >>obviously something else is making this happen. I need to have it name the
    >>components using ControlID:ComponentID so that my code works. What might
    >>be causing this different naming method? Thanks.
    >> --
    >> Nathan Sokalski
    >> [email]njsokalski@hotmail.com[/email]
    >> [url]http://www.nathansokalski.com/[/url]
    >>
    >
    >

    Nathan Sokalski Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139