Nested usercontrols - system.page not reachable?

G

Guest

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
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top