Monday, March 26, 2012

Call method of Master page from Update panel

Hi,

How to call the method of master page from the UpdatePanel. Do I need to write a trigger? Provide the syntax.

Calling your master page from an update panel is no different from doing it on a "normal" page. All you need to make sure is that you have added a reference to your MasterType in your aspx code:

<%@. MasterType VirtualPath="~/MasterPage.master" %>
Then you can do Master.SomeMethod() from your page.

Hi,

Thanks the above code is already added. I have implemented the same, it is woring fine for the controls outside the Update panel. Same method call is not supported from update panel.

Jist of what I am looking at:

I want to display a message in the master page, which is a UserControl. I am facing the problem in invoking a method of UserControl in Master page from child page, all the controls in child page are embaded in the UpdatePanel.

Can you provide the syntax for the same

How the following line of code can help me?

ScriptManager.GetCurrent(this.Page).RegisterAsyncPostBackControl( );


Hi,

Thank you for your post!

To invoke a method of UserControl in Master page from child page? or fire an event of the UserControl?

Invoke a method of UserControl in Master page from child page lkike this!

UserControl uc = ((UserControl)Master.FindControl("uc1"));
uc.yourmethod();

If you have further questions, let me know.

Best Regards,

No comments:

Post a Comment