Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Read Variable from content page, declared in masterpage

Posted on 2010-01-11
4
Medium Priority
?
546 Views
Last Modified: 2013-11-26
Hello people, I would like to know if someone can help me with a little problem.
I did a masterpage, and I declared somes variables with a value.

I want to access to those variables from a content page.

How I can do it?

Thanks
0
Comment
Question by:nkoriginal
4 Comments
 
LVL 11

Expert Comment

by:rajvja
ID: 26283173
Site masterpage = Page.Master as Site
masterpage.variablename

http://www.asp.net/(S(sf10gzjodvrpce55el2p5cnk))/learn/master-pages/tutorial-06-cs.aspx
0
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 26283183
U'll have to declare public properties in the master page to access the values in a content page.

http://msdn.microsoft.com/en-us/library/xxwa0ff0.aspx
0
 
LVL 10

Expert Comment

by:krunal_shah
ID: 26283204
Hi,

you can assign that variable to asp  hidden field in master page and access that hidden field in the content page as shown in this example ( it access the text box control of the master page),

http://msdn.microsoft.com/en-us/library/xxwa0ff0.aspx

Thanks,
Krunal
0
 
LVL 7

Expert Comment

by:waltersnowslinarnold
ID: 26283249
You can do as below..

Master.FindControl("controlName");
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question