Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > reference to parent page

Reply
Thread Tools

reference to parent page

 
 
dik@lul.com
Guest
Posts: n/a
 
      06-20-2005
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...
 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      06-20-2005
wrote:
> 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...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Set Parent Scroll Position - parent page and iframe on seperate domains PD Javascript 6 05-09-2006 03:37 PM
Page load of the parent page called twice when a modal dialog is opened from a button click of the user control on the parent page Samy ASP .Net 2 08-15-2005 03:30 PM
What does sender.Parent.Parent.Cells() reference? Frustrating... Roy ASP .Net 2 02-11-2005 09:00 PM
Getting a page to refresh the parent, even when not loaded from the parent? Bill S. Javascript 2 05-08-2004 04:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57