Nested usercontrols - system.page not reachable?

Discussion in 'ASP .Net' started by =?Utf-8?B?U3Vl?=, May 19, 2006.

  1. Web app: asp.net 2003, IE, IIS, VB
    top: system.page
    -first level: placeholder
    --second level: usercontrol
    ---third level: user control containing a datagrid

    Datagrid itemdatabound assigns:
    Dim button As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
    e.Item.Cells(1).Attributes("onclick") =
    Page.GetPostBackClientHyperlink(button, "")

    When debugging "Page" is nothing. "Me.Page" is nothing. Traced "e's" parents
    back to the datagrid object at which point the datagrid's parent is nothing.

    If I place the usercontrol containing the datagrid in a placeholder and the
    placeholder on web page, this works just fine.

    Just out of curiosity, why does the datagrid not see it's parent usercontrol
    when the parent usercontrol is a control of another usercontrol?

    Hope this makes sense....

    tia,
    Sue
    =?Utf-8?B?U3Vl?=, May 19, 2006
    #1
    1. Advertising

  2. Turn on Trace ... inspect Trace.axd for particular request of page and see
    whole tree of controls on your page. You will get answer.



    "Sue" wrote:

    > Web app: asp.net 2003, IE, IIS, VB
    > top: system.page
    > -first level: placeholder
    > --second level: usercontrol
    > ---third level: user control containing a datagrid
    >
    > Datagrid itemdatabound assigns:
    > Dim button As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
    > e.Item.Cells(1).Attributes("onclick") =
    > Page.GetPostBackClientHyperlink(button, "")
    >
    > When debugging "Page" is nothing. "Me.Page" is nothing. Traced "e's" parents
    > back to the datagrid object at which point the datagrid's parent is nothing.
    >
    > If I place the usercontrol containing the datagrid in a placeholder and the
    > placeholder on web page, this works just fine.
    >
    > Just out of curiosity, why does the datagrid not see it's parent usercontrol
    > when the parent usercontrol is a control of another usercontrol?
    >
    > Hope this makes sense....
    >
    > tia,
    > Sue
    =?Utf-8?B?QWx0YWYgQWwtQW1pbiBOYWp3YW5p?=, May 21, 2006
    #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. [XtOf].fr
    Replies:
    0
    Views:
    375
    [XtOf].fr
    Jan 2, 2004
  2. Aaron C. Roberts

    WebParts: Nested UserControls

    Aaron C. Roberts, Jun 22, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    423
    Aaron C. Roberts
    Jun 22, 2006
  3. Fabian Steiner

    How to test whether a host is reachable?

    Fabian Steiner, Feb 22, 2007, in forum: Python
    Replies:
    5
    Views:
    586
    Bart Ogryczak
    Feb 22, 2007
  4. Ke Tao

    Detect internet reachable

    Ke Tao, Jul 18, 2007, in forum: C Programming
    Replies:
    6
    Views:
    308
    David Thompson
    Aug 26, 2007
  5. Tony Johansson
    Replies:
    3
    Views:
    347
    Martin Honnen
    Jul 3, 2010
Loading...

Share This Page