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
What is the use of session in web application?
What is owin authentication?
what are the ihttphandler and ihttphandlerfactory interfaces ?
What is the difference between union and join?
What does ascx stand for?
Which two new properties are added in asp.net 4.0 page class?
What is the difference between page directive include and action tag include?
Explain the different types of assemblies?
Explain the difference between codebehind="mycode.aspx.cs" and src="mycode.aspx.cs"?
How can we create custom controls in asp net?
Who is using asp.net?
What is state management technique?
Explain the main differences between asp and asp.net?
What kind of programming language is ASP.NET?
What is a query string in a url?