Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / May 2005

Tip: Looking for answers? Try searching our database.

acces controls on aspx page from user control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fabrice - 25 May 2005 08:14 GMT
Hello,

I'm trying to access a Label Control on my .aspx  page from a User Control.
But I don't manage it.
Do somebody help me to do that ?

My aspx is mypage.aspx
a control label in it :

<asp:Label id="myLabel" runat="server"></asp:Label>

In  ascx :
How to fix the Text property of the label ID=mylabel.

thanks a lot.

fabrice
Brock Allen - 25 May 2005 18:39 GMT
You can use FindControl("YourControlID"), but IMO it's a bit odd (and perhaps
indicative of a flawed design) to have a user control make an assumption
about the presence of a Control elsewhere on the page.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hello,
>
[quoted text clipped - 11 lines]
>
> fabrice
MasterGaurav - 26 May 2005 06:40 GMT
If the UserControl is under your control (at design time), I would
suggest that "myLabel" is made public.

That's the best way to go about it.

--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.