CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/30/2006 7:43:42 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
AlineS
Asp.Net User
How can I change property of a label in a Masterpage?8/30/2006 7:43:42 PM

0/0

Hey Guys, I have a blue colored label text in a masterpage. On the contentpage I'd like to change the label color. How can I do that?
StrongTypes
Asp.Net User
Re: How can I change property of a label in a Masterpage?8/30/2006 8:02:08 PM

0/0

You'll need to create a public property that exposes the Label and use the MasterType directive on the content page.

Ryan 


Ryan Olshan
Microsoft MVP, ASP.NET
Blog | Group | Website | Strong Coders Community

How to ask a question
AlineS
Asp.Net User
Re: How can I change property of a label in a Masterpage?8/30/2006 8:11:21 PM

0/0

I have tried it, doesn't work. Maybe I missed something:

 

Masterpage

 <asp:Label ID="Label1" runat="server" Text="Label" ForeColor="Blue">blue text</asp:Label>

 Code:

 private string _color;

    public string Color
    {
        get { return _color; }
        set { _color = value; }
    }

 

Contentpage:

  protected void Page_Load(object sender, EventArgs e)
    {
        Master.Color= "red";
     
       
    }

 How can I change color of "Label1"? There should be a connection to Label1 but I don't know where (sorry, I am a learner!)



 

Minhajkk
Asp.Net User
Re: How can I change property of a label in a Masterpage?9/6/2006 7:11:18 AM

0/0

Label label = (Label)Master.FindControl("nameLbl");

label.BackColor = System.Drawing.Color.Orange;


Muhammad Minhaj Mehmood
E-mail: [email protected]
Cell: +92 (333) 2715467
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Pro ASP. Net 3. 5 Server Controls and AJAX Components Authors: Rob Cameron, Dale Michalk, Pages: 740, Published: 2008
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
Beginning Visual Basic 2005 Authors: Thearon Willis, Bryan Newsome, Pages: 799, Published: 2006

Web:
How can I change property of a label in a Masterpage? - ASP.NET Forums How can I change property of a label in a Masterpage? Last post 09-06-2006 3:11 AM by Minhajkk. 3 replies. Sort Posts: ...
Can't access label in MasterPage I'm having a problem with a label in a MasterPage which is not in a ... The naughty label will not allow me to change its text property. ...
Access Controls Contained in a MasterPage through a Content Page ... Let's say for example you have a label placed on your master page. You decide you want to modify the Text property of this label. ...
TheMSsForum.com >> Asp >> How To: Set Label Text Property In ... How do i set the text property for a label control on my master page? ... property change...? Alternatively, do you have more than one MasterPage. ...
Change text of a master page label from a content page - ASP.NET ... Change text of a master page label from a content page ... You could just create a writeonly property on the master page, and call the property to wirte a ...
Accessing the controls and methods of a MasterPage (ASP.NET ... What's left is setting the label of the MasterPage through code, ... you are looking to do is to change the value of a label or access the properties of a ...
change master page labels from content page - telerik Forum back in the masterpage, I placed the label, lblCartItems, ... with the labels and set the visible property to false(a component is needed ...
Alessio Marziali » ASP.NET MasterPage object tricks May 5, 2008 ... The content page can now change the text. The only caveat is that the Master property returns an object that’s typed as the generic ...
Update a label on a Master Page in .Net 2.0 : ASP.Net, 2.0 I have a master page on which I have a label. I would like to change the value .... the Label's Text property inside your own property in the master page's ...
Change user control style (VB.net) : Control Style « User Control ... End Property




Search This Site:










form on master page?

sitemappath and custom providers

asp.net2.0 menu controls for content pages

dynamic content pages for master page

master page, response.redirect and viewstate

treeview with dropdown nodes

sitemap not working

master pages and images

open a treeview at the right place

can you force asp.net to use absolute urls instead of relative ones for theme/css sources?

how would you add two contentplaceholder with same name?

is it a good idea for your sign on page to have a master template(thinking security)

treeview persist state

treeview for my cms

share master pages between projects and have design time rendering

sharepoint help

nikhil's updatehistory and masterpages

using javascript calendar in content page

apply theme in design view in vs2005/ide

setting masterpage client onload from contentpage

treeview problem

javascript and master page problem

how to use tab control?

untitled page using master pages

holy grail - can main content center be made scrollable?

moveable column divider

.net 2.0 menu questions

why not using contentplaceholder in existing window?

tree view question

nested contentplaceholder - bad practice?

  Privacy | Contact Us
All Times Are GMT