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 / January 2008

Tip: Looking for answers? Try searching our database.

Code for Accessing the controls of masterpage in its content page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sonu - 31 Jan 2008 12:31 GMT
I have to change the controls (panel)'s top and other properties of
master page after accessing it in it's content page.
Eliyahu Goldin - 31 Jan 2008 13:02 GMT
Use this line
<%@ MasterType virtualpath="myMasterPage.master" %>
to access public properties of the master page from the content page.

Note, that the controls in .aspx file are protected and not public. You can
make a public property like
public Panel MyPanel {get{return myPanel;}}
where myPanel is defined in the markup as
<asp:Panel runat="server" id="myPanel" />

But a much better practice would be to make a public method in the master
page that will set the panel properties according to the parameters you will
pass from the content page.

And consider setting position properties on client side.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

>I have to change the controls (panel)'s top and other properties of
> master page after accessing it in it's content page.

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.