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 are the uses of reflection?
What is asp.net globalization?
What is a url string?
Am not able to move the controls on the form freely in asp.net 3.5 even though I selected the position as relative or absolute for those controls. What should I do to overcome this?
What are themes and skins in 2.0, explain usage scenario?
What is server redirect?
Which is better asp.net or php?
What is the difference between CC and BCC?
Which method do you use to kill explicitly a users session?
How will create assesblies at run time?
Is it right that ASP.NET Web API has replaced WCF?
Can we make activex dll also ti execute in some process as that of client ? How can we do?
How do we sort the data from a dataset?
What is master page in dtp?
Which is faster viewbag or viewdata?