开发者

Link button control using asp.net

I have set of link buttons in my masterpage and one button in my content page. i want when i click the any one of link button in the masterpage the value in the content page will change. How i can do this. Can any one able to help me because i 开发者_运维知识库am new in asp.net Thank you


you can do something like this from your master page

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


You can set it up with events. In your master page:

public event EventHandler<EventArgs> SomethingChanged;

In your content page:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜