By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,620 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,620 IT Pros & Developers. It's quick & easy.

Call Function from assigned Master Page

P: n/a
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

Nov 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Da**************@gmail.com wrote:
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
Nov 27 '06 #2

P: n/a
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

Masudur wrote:
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

Da**************@gmail.com wrote:
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
Nov 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.