473,404 Members | 2,195 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,404 software developers and data experts.

Master Page Question


....if this isn't the best newsgroup for this question, perhaps someone can
point me to the best one.

If I'm using vb.net with visual studio 2005 ..

and I want to create a button on a master page and have that button run code
contained on another page, how might I best accomplish this?

Thanks

Jeff
May 28 '07 #1
2 1233
"Jeff" <no**@nothingX.comwrote in
news:eV*************@TK2MSFTNGP06.phx.gbl:
and I want to create a button on a master page and have that button
run code contained on another page, how might I best accomplish this?
What do you mean run code on another page? Like execute a function that is
in a codebehind file of another ASPX page?

You can just instantiate Page B in Page A and call the function if it's
public. Or even better, move the function to a class file... and
instantiate the class.
May 28 '07 #2

"Spam Catcher" <sp**********@rogers.comwrote in message
news:Xn**********************************@127.0.0. 1...
"Jeff" <no**@nothingX.comwrote in
news:eV*************@TK2MSFTNGP06.phx.gbl:
>and I want to create a button on a master page and have that button
run code contained on another page, how might I best accomplish this?

What do you mean run code on another page? Like execute a function that is
in a codebehind file of another ASPX page?

You can just instantiate Page B in Page A and call the function if it's
public. Or even better, move the function to a class file... and
instantiate the class.

I think that I'm figuring out most of this from your hint. Here is what I
still don't get.

I have a button on a master page and would like to control a label on a
content page that relies upon the master.

if I use the code below in the next button it will work to change label1 on
the content page.
Dim lbl As Label =
Me.FindControl("ContentPlaceHolder1").FindControl( "label1")
lbl.Text = "testing"

But if I want to take the code above and move it to a sub in a class file, I
can't figure out how to modify the
Me.FindControl (in the code above)
so that I can refer to the masterpage that called the sub.

Can you point me in the right direction?

Thanks

Jeff

May 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
by: Fred Nelson | last post by:
I have a question regarding page caching in a C# Web App that I'm developing. I have used page caching successfully in VS2003 at the page level - and it also works the same in VS2005. I have...
13
by: Michael | last post by:
I have setup a public variable in the Master Page "code-behind-file". Now I would like to set that value from the UserControl, but I can't seem to find a way to do this. Does anyone have any ideas?...
5
by: Kevin | last post by:
We currently have a 1.1 class library which houses the look and feel of our website by creating the html form dynamically in a base class. We then distribute our assembly to other application...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
2
by: n# | last post by:
I have an old existing website with a Header/ Left Hand Menu and a iframe as the main body content, adjacent to the menu. So for every click on the menu item, I used to load a aspx page on the...
4
by: lichaoir | last post by:
I have two questions about the use of Master Page: 1. How to access properties and controls in the master page from content page? (I know I can use the "FindControl()" method of the "Master"...
0
by: KingKong07 | last post by:
Hi! I have a problem with publishing my solution. I use “Use fixed naming and single page assemblies” to publish. So I just can update one and one file, this works fine, but today I had to update...
5
by: Murray | last post by:
Forgive me if this question is too basic, but I'm new to ASP.NET programming, and I can't locate a simple answer to this question. I have a web page that consists of a Master Page and a single...
6
by: Mickey | last post by:
Coming from a Dreamweaver/ASP/PHP background. Planning to use Visual Studio 2008 for a website. Complete newbie question here (please be gentle!): Do master pages work similar to Dreamweaver...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.