Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
is there any way to findout the control of master page on aspx page that is not created by master page (means thatis sample aspx page) :sigh:
Posted
Comments
raju melveetilpurayil 30-Jul-10 3:44am    
can explain little your question? do you want to find controls in master page from content page?
R. Giskard Reventlov 30-Jul-10 5:08am    
Reason for my vote of 1
Don't respond to an answer by creating another answer!

You'll need to clarify your question as you have already been asked to do. If you don't then you'll not get an answer.

You're question is difficult to decipher but I'll have a try.

If you mean, can you reference a control on a master page from an asp.net child page then, yes, you can.

You could try, for instance:

Label label = (Label)Parent.FindControl("Label1")


or you might substitute Master for Parent depending upon where you are calling from and to. You may also have to extend the call if the control is nested. If that is total rubbish then you'll need to clarify your question.
 
Share this answer
 
You can use Master object from content page,

How to: Reference ASP.NET Master Page Content[^]
 
Share this answer
 
v2
You can get control of the Master Page if you can access the page or any other page that is a content of that master page.

Since current ASPX page is not using any MasterPage, you won't be able to access it directly.

BTW, what kind of scenario is this? Surely some bad design case or there would be another option to do what actually you are trying to do.
Better would be to update the question properly with details of your scenario and then try out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900