reference to parent page

  • Thread starter Thread starter dik
  • Start date Start date
D

dik

Hi

how do i change a property of a webcontrol that is on a asp.net from the code of a usercontrol? In other words what is the way to refer to the page from this user object?

ch Dik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Hi

how do i change a property of a webcontrol that is on a asp.net from the code of a usercontrol? In other words what is the way to refer to the page from this user object?

ch Dik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Well, the UserControl has a .Page property. However, it's bad design
IMHO for a UserControl to try to access other controls on a page.
Mainly because a UserControl is supposed to be a 'black box', and
reusable across pages. Which wouldn't be possible unless all pages
conform to some 'design' that is common knowledge to all user controls.
Not common....

A better design is for a usercontrol to create events that it
externalizes that the Page class can then handle and do the appropriate
work. Really the Page class should be the 'controller' in this
relationship....

Just a design remark...
 
Back
Top