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
Is data edited in the Repeater control?
How to use multiple scriptmanager controls in a web page?
What is difference between View State and Hidden Field in ASP.NET?
How to implement form based authentication in asp.net application?
Which asp.net objects encapsulate the state of the client and the browser?
What is the difference between union and join?
Explain the path instructions in xaml?
What is a user session?
What is the difference between the response.write() and response.output.write() methods?
Explain the use of fragment caching.
What is an imagemap in asp.net?
What are HTTP handlers in ASP.NET?
How can we create custom controls in asp net?
Is there any limit for query string? Means what is the maximum size?
How to create discussion forum in asp.net mvc? : Asp.Net MVC