Groups | Blog | Home
all groups > asp.net building controls > september 2005 >

asp.net building controls : how to access user web control from parent page?


Chris
9/28/2005 8:04:03 AM
Hi,

I've created a user web control with 4 drop down list boxes in it.

I've added this user control to my main web form page.

I created the references to it in the class constructor:

protected System.Web.UI.UserControl ReportLocationSelector;


in the code behind page for the main webpage how do I programatically gain
access to the reportlocationselector controls methods, properties and events.

this.reportlocationselector.?

thanks

Peter Zolja
9/29/2005 5:34:10 PM
[quoted text, click to view]

It may be that I don't understand exactly what your situation, but shouldn't
that be?

protected MyControlClassName ReportLocationSelector;

-- to access a property: ReportLocationSelector.SomeProperty = SomeValue;

If you added the control using VS you should not have to do this (of course
it depends on how/what you did)


AddThis Social Bookmark Button