User controls
How we can invoke user controls public method from within the page?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant KumarPosted Oct 19, 2011, 1:35 AM
Based on my understanding, you want to know how to call the method that is declared on the page from UserControl. If I have misunderstood you, please feel free to let me know.
We can call the method that is declared on the page from UserControl in the asp.net 2.0. For example, we can create an abstract base class for the Page in the App_Code folder. The following is the abstract base class which will be inherited by the Page:
In the Page, we need to inherit this base class and override the abstract method declared in the base class:
In the UserControl, We just need to call the method which exists in the base class: