CodeVerge.Net Beta


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

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 12/10/2007 9:21:26 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
PAFlyfisherman2
Asp.Net User
Problems Accessing Public Properties Declared in Master Page12/10/2007 9:21:26 PM

0/0

Hi,

I've created a master page for my site and within the master page code behind I created two public properties for access to two label controls contained in the master page. When trying to access these properties from the code behind of my web page which inherits this master page, the properties do not appear in intellisense. I would think that public properties in the master would be accessible to pages that implement the master... Is there something amiss?

 

Thanks,

Paul


Paul R
Rinze
Asp.Net User
Re: Problems Accessing Public Properties Declared in Master Page12/10/2007 10:05:14 PM

0/0

don't be fooled by the apparent master > page relation. The master page is actually rendered as a child control of the page.

Using the public properties to expose the controls is the way to do it. Try accessing them by using the master property in the page: Master.Label1, Master.label2


Hope this helps !
Rinze

---------
please select 'mark as answer' if this post helped you!
ihaathi
Asp.Net User
Re: Problems Accessing Public Properties Declared in Master Page12/11/2007 12:02:59 AM

0/0

Paul,

The way I have done this is by using the <%@ MasterType VirtualPath="~/MyMasterPage.master" %> page directive in the content (child) pages.

For more info on MasterType, see here.


 


iHaathi
This post is given AS-IS. No Warranties.
PAFlyfisherman2
Asp.Net User
Re: Problems Accessing Public Properties Declared in Master Page12/11/2007 2:02:34 PM

0/0

Thank You very much Ihaathi - you're advice was right on and Thanks too for the reference at MSDN! Yes

 I have to admit too, coming from using and/or creating common headers, footers and structure via user controls, master pages are so much cleaner, and to be able to programmatically control things makes it even better.

Regards,

Paul


Paul R
ovaisgeo
Asp.Net User
Re: Problems Accessing Public Properties Declared in Master Page12/17/2007 8:30:37 AM

0/0

Suppose u have a Panel in ur master page then u access the panel control in content page then we use this code

Masterpage.master.vb

Public Property PanelTag() As Boolean

Get

Return Panel1.Visible

End Get

Set(ByVal value As Boolean)

Panel1.Visible = value

End Set

End Property

Content.aspx.vb

Dim master As MasterPage = Page.Master

master.PanelTag = True

 

 

 

 

Muhammad Ovais

Web Developer

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008

Web:
How to access a string declared in MasterPage - ASP.NET Forums Declare GlobalCs as a property of the Master page and then in your content ... public partial class MasterPage : System.Web.UI.MasterPage ...
How to access a string declared in MasterPage - ASP.NET Forums Declare GlobalCs as a property of the Master page and then in your .... I tried what you sent, and I can access the public string from my ...
How to: Reference ASP.NET Master Page Content The rule for properties and methods is that you can reference them if they are declared as public members of the master page. ...
Master Pages in ASP.NET | O'Reilly Media Once you have that property declared in the master page, you can access it in the .aspx page, as follows: public partial class LibertyOnWhidbeyPage3_aspx ...
CodeProject: Inside Master Pages. Free source code and programming ... It returns an instance of the MasterPage class. To access controls inside the master page, there are two methods:. Using public properties/methods ...
Master Pages - Strongly-Typed control access - .NET ASP I can access *properties* on the Master Page in a strongly typed way, .... some of the controls - to get them declared as "Public" rather ...
Master Page Inheritance and User Controls - Rick Strahl's Web Log I'm accessing properties from the main master, but here things get a ... a base class in App_Code with the User control(s) declared as public properties of ...
Master Pages in ASP.NET 2.0 ??? - DevX.com Forums I so far understand how to acces controls on a master page, but the problem I am having is accessing classes and variable that I create in ...
Creating a Custom Membership Provider and Membership User ... Public MustInherit Class BaseMaster ' Inherits MasterPage '2. Defined a UserLevel property in it with MustOverride access ' modifier '3. Made master page to ...
K. Scott Allen : Master Pages Text = vlaue in the Public Property FooterText()As String section of the ..... I never used to have this problem before master pages - is this because I am ...

Videos:
Long Beach City Council Meeting Long Beach City Council Meeting
Hidabroot אסטרולגיה Astrologia astrology עוד לפני אלפי שנים עסקו אנשי העולם העתיק בחקר Astrologia מידע הטמון בקרבי השמים אודות גורלו של האדם ואופיו. האיצטגנינות או בשמה המודרני אסטרולוגיה ה...
www.moldytoaster.com or entrenchments. Mrs. Smith then demanded a truce until evening, which was granted by Mrs. Brown; notwithstanding which the former lady was detected...
Long Beach City Council Meeting Long Beach City Council Meeting




Search This Site:










accessing contentplaceholderid from master page codebehind

menu control not displaying images !!

the name of a textbox when it is goes to the client when using master pages

hi, i have a problem with a stylesheet when i place it in the app_themes asp,net folder. can somebody please help me?

asp:menuitem, how do i get rid of the arrow when i make a submenu?

loss of menu control on site

asp.net navigation

ie vs firefox.. asp menus

accessing objects inside the master page from a calling form

storing themes in a folder other than "themes"

any performance issues using themes & skins

<title> tags and line breaks?

hide masterpage table

easier way to access an instance?

q: how to disable a node in a treeview?

how to set a image path to consume multiple themes?

using multiple master pages?

how to share master page among applications?

master page custom event problem

menu error - internet explorer cannot open the internet site, operation aborted

tree view works through vwd but not via local host or from a remote browser.

title tag in master pages

javascript problem in master content pages

activestepchanged event occurs when a wizard control first loads

literal control not allowed within skin file???

how to change the name of the treeview category in order to pass as a parameter to sql procedure?

masterpage and flash

performance issues with menu control

i cant navigate the wizard

menu

  Privacy | Contact Us
All Times Are GMT