reference to parent page

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...
 
C

Craig Deelsnyder

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...
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top