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?



I have a method written in WebForm (means .aspx page) & now I want to call this method in WebU..

Answer / 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

More ASP.NET Interview Questions

Why cyclomatic complexity is important?

0 Answers  


how can create login from create and written conde in asp.net

0 Answers  


Disable Session State at the Application Level

2 Answers  


Uses of CLR ?

2 Answers   Mind Tree, PH Software, TCS,


What does aspcompat="true" mean?

0 Answers  






How can you use a custom controls in ASP.NET application?

0 Answers   Sans Pareil IT Services,


Explain how asp.net different from asp?

0 Answers  


Write a code for sending an email from asp.net application.

0 Answers  


How many types of Cookies are available in ASP.NET?

0 Answers   MindCracker,


Explain asp.net application life cycle?

0 Answers  


How many column in table of sql server?

3 Answers  


How asp.net mvc differs from asp.net web forms? : asp.net mvc

0 Answers  


Categories