Call Function from assigned Master Page

  • Thread starter Thread starter Darren.Ratcliffe
  • Start date Start date
D

Darren.Ratcliffe

Hi

If I have functionX in my master page, how would I call the function
from my .aspx page that has the master page assigned to it?

Many thanks

Darren
 
Hi Darren

Well Let Say you have a Master page name MyMasterPage.Master and its
codebehind file is
MyMasterPage.Master.cs. and you have funtionx in MyMasterPage.Master.cs
and you have default.aspx page and in default.aspx.cs codebehind file
you want to use the funtion
here is the code

( (MyMasterPage) Page.Master ).Funtionx();
when u use master page in a page the page object contain the reference
of the master page
all you have to cast the Page.Master in your master page file class .
after that you can use the funtions just like a normal class

Thanks

Md. Masudur Rahman
Kaz Soffware Ltd.
www.kaz.com.bd
 
Thanks for the response Masudur.

I am going to have a look at this at the start of next week now - I'm
currently toilling with Indexers!

Many thanks

Darren
 
Back
Top