Thursday, March 29, 2012

Pass Parameter To MasterPage ?

How do you pass a parameter into the master pages, much like the TITLE.
I'd like to pass SectionID from the ChildPages to the MasterPage
(which calculates information based on SectionID)A good way is to declare a public property SectionID on the master page and
set it from content pages as this.Master.SectionID=xxx

You will need to add a line

<%@. MasterType virtualpath="~/MyMaster.master" %>

into your content page.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<googlegroup@.desiboy.comwrote in message
news:1168928761.038462.121050@.38g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

How do you pass a parameter into the master pages, much like the TITLE.
I'd like to pass SectionID from the ChildPages to the MasterPage
(which calculates information based on SectionID)
>

0 comments:

Post a Comment