How Do I: Send Text to a control in my User Control

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

Hello,
I am in ASP.NET using C#.
I have a user control called "progHeader.ascx" that has
a label control call "pageTitle". How do I
call "pageTitle" from my asp page(Inventory.aspx), with
the usercontrol "progheader" dropped on to it, and send
the current page title to "pageTitle"?
Charles
 
Hi Charles,

Thank you for posting in this group.
Is your user control created by yourself or by others?

If it is created by yourself, you can create the label as the public
reference of user control class.
Then you can manipulate the label in the control like this:
WebCustomControl11.Label1.Text="abc";

Also(And more reasonable), you can create a public property for the label
and you can manipulate it through the property.

If the control is not created by yourself and it does not expose any
property or public reference field for the label, it means that the creator
of the usercontrol does not want you to manipulate it, this label is for
some internal usage of this user control.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Charles" <[email protected]>
| Sender: "Charles" <[email protected]>
| Subject: How Do I: Send Text to a control in my User Control
| Date: Fri, 3 Oct 2003 16:59:29 -0700
| Lines: 8
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOKCmIMy3y+hnzqR1Kn6CzbkEBKIA==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:188882
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hello,
| I am in ASP.NET using C#.
| I have a user control called "progHeader.ascx" that has
| a label control call "pageTitle". How do I
| call "pageTitle" from my asp page(Inventory.aspx), with
| the usercontrol "progheader" dropped on to it, and send
| the current page title to "pageTitle"?
| Charles
|
 
Back
Top