"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