Webcontrol containing other controls issue (please, IMPORTANT!)

Discussion in 'ASP .Net Web Controls' started by Ivan Demkovitch, Oct 7, 2003.

  1. Hi!

    I posted question while ago with no reply..

    Here is wat I do:

    I have website with 1 page (pgracing.com)
    Each block/module is a control - .ascx.

    In one of them I dynamically create comboboxes, textboxes, etc. Then I add
    submit button and hook it up to event handler.

    When button pressed I need to read values from this dynamically added
    controls.

    Page.Find control does not work because ID is not ID I assigned. It gets
    prepended with somethig like "Ctl0_"

    I understand that ASP.NET does this so I can distinguish between
    usercontrols on a page, however it doesn't help me.

    I can probably loop thru all controls and compare ID endings, but this
    doesn't look correct to me.

    How would I get a value? Please ask any questions if I'm not clear.


    Thanks!
    Ivan Demkovitch, Oct 7, 2003
    #1
    1. Advertising

  2. SOLVED

    Since I had code in ASCX ID was prepended with additional ID for ASCX
    itself.

    Changing Page.FindControl to this.FindControl cured problem.


    "Ivan Demkovitch" <> wrote in message
    news:...
    > Hi!
    >
    > I posted question while ago with no reply..
    >
    > Here is wat I do:
    >
    > I have website with 1 page (pgracing.com)
    > Each block/module is a control - .ascx.
    >
    > In one of them I dynamically create comboboxes, textboxes, etc. Then I add
    > submit button and hook it up to event handler.
    >
    > When button pressed I need to read values from this dynamically added
    > controls.
    >
    > Page.Find control does not work because ID is not ID I assigned. It gets
    > prepended with somethig like "Ctl0_"
    >
    > I understand that ASP.NET does this so I can distinguish between
    > usercontrols on a page, however it doesn't help me.
    >
    > I can probably loop thru all controls and compare ID endings, but this
    > doesn't look correct to me.
    >
    > How would I get a value? Please ask any questions if I'm not clear.
    >
    >
    > Thanks!
    >
    >
    >
    >
    Ivan Demkovitch, Oct 7, 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. Ivan Demkovitch
    Replies:
    1
    Views:
    324
    Ivan Demkovitch
    Oct 7, 2003
  2. Guest
    Replies:
    2
    Views:
    730
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    197
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    183
    Kasabaarde Sumta
    Dec 13, 2004
  5. CubeFish

    Webcontrol containing a UserControl?? Problem ...

    CubeFish, Feb 21, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    114
    CubeFish
    Feb 21, 2004
Loading...

Share This Page