DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 7 Aug 2007 23:21:34 -0500,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Fred Chateau


Accesss User Control Class From Containing Page   
I am trying to access a user control class, for a user control that is 
loaded dynamically, from the containing page. I have been able to access Web 
controls in the user control, but so far I have been unable to expose the 
user control class itself. I'm guessing that I need to set up an interface, 
but I am not sure how to accomplish this.

Here is the code that loads the user control:

protected void Page_Init(object sender, EventArgs e)
{
UserControl bottomPanel = (UserControl) LoadControl("~/Reviews.ascx");
bottomPanel.ID = "Reviews_ascx";
PlaceholderUserControl.Controls.Add(bottomPanel);
}

----
Here is how I access Web controls in the user control:

PlaceholderUserControl.Controls[0].FindControl("radReview");

----

I need to set a property of the user control for data access, but this is a 
far as I've been able to go.

-- 
Regards,

Fred Chateau
fchateauAtComcastDotNet
Date:Tue, 7 Aug 2007 23:21:34 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us