I have a method written in WebForm (means .aspx page) & now
I want to call this method in WebUserControl (means .ascx
page) what should I have to do?
Answer Posted / jp
Use the controls page property and typecast it to the page
class name.
eg:
Page Default.aspx has a control MyControl.ascx
Page Default.aspx.cs has a method MyMethod()
in MyControl.ascx.cs
((Default)(this.Page)).MyMethod();
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
Describe how ASP.NET maintains process isolation for each Web application?
What are the parts of an http response?
How would you get asp.net running in apache web servers?
What do you mean by caching in asp.net?
What is s2s tracking?
How do you implement sql caching in asp.net?
What is web api config?
Why is global asax is used?
What is form method?
What is different authentication mechanisms used in ASP.NET?
How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?
Explain the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
What are the difference between overriding and overloading?
What are the asp.net security controls?
Give an example of what might be best suited to place in the application_start and session_start subroutines?