Controlling a link button using asp.net

I have a set of link buttons on my main page and one button on my content page. I want, when I click on any link button on the main page, the value on the content page will change. How can i do this. Can someone help me because I'm new to asp.net Thank you

+4
source share
2 answers

you can do something like this on your main page

var linkButton = ContentPlaceHolder1.FindControl("contentPageButton1") as LinkButton; linkButton.Text = "Foo"; 
+3
source

You can configure it using events. On the home page:

 public event EventHandler<EventArgs> SomethingChanged; 

On your content page:

 protected override void OnInit(EventArgs e) { base.OnInit(e); ((MyMasterPage)Page.Master).SomethingChanged += (s, ev) => UpdateStuff(); } 
+1
source

All Articles