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 / General / July 2007

Tip: Looking for answers? Try searching our database.

Setting Properties of User Control On Master Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mick Walker - 24 Jul 2007 09:50 GMT
Hi All,

I have a user control on my master page, which exposes 3 public
properties (all boolean). Basically by the values of these properties,
the user control builds a menu to for users to navigate through the website.

I am wondering, how can I set the property of a usercontrol contained
within a Master Page, from a content page?

Kind Regards
Sergey Poberezovskiy - 24 Jul 2007 10:32 GMT
Usually by exposing them as Master page properties - as your user control is
"internal" to the master page, it makes sense to only manipulate them within
it.

> Hi All,
>
[quoted text clipped - 6 lines]
>
> Kind Regards
Mick Walker - 24 Jul 2007 10:52 GMT
Could you please give me an example of how to achieve this please?

> Usually by exposing them as Master page properties - as your user control is
> "internal" to the master page, it makes sense to only manipulate them within
[quoted text clipped - 10 lines]
>>
>> Kind Regards
Brandon Gano - 24 Jul 2007 18:18 GMT
--master.master--
<asp:Label ID="lblWelcomeMessage" runat="server" />

--master.master.cs--
public string WelcomeMessage
{
 get { return lblWelcomeMessage.Text; }
 set { lblWelcomeMessage.Text = value; }
}

--page.aspx.cs--
protected override void OnLoad(EventArgs e)
{
 base.OnLoad(e);
 this.Master.WelcomeMessage = "Hello World!";
}

> Could you please give me an example of how to achieve this please?
>
[quoted text clipped - 13 lines]
>>>
>>> Kind Regards

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.