473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Call Function from assigned Master Page

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
2 11495
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
9
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a...
5
by: Miguel Dias Moura | last post by:
Hello, I am working on an Asp.Net 2.0. I created a master page named "MyMasterPage.master". I created the function "SUM" in my master page VB code. I then created the page "MyPage.aspx" from...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
2
by: Antonio | last post by:
Hi, I would like to have my TreeNode to call window.close(); without posting back, how can I do that? At the same time, I prefer to have a SelectAction property that allows my TreeNode to appear...
1
by: Ganesh | last post by:
How to call javascript in a asp.net master's content page, i tried something like this but it's not working. <%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true"...
4
by: faraz | last post by:
I have a javascript function that i want to call masterpage load method called. I cant add onLoad event of body or table in master page. I have put the call to script function in <form>, it...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.