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

What's the use of response.output.write()?

0 Answers  


and can u telme how to explain about our job profile if i have 3years of it experiance in dotnet domain and where to start and where to end , and what shoul i tel and what not(can i mention my education ,and family details,......)i am confusiong a lot. can i ask one with your permision, if u have question that u u went tcs interview as 3+years exp so he/she asked tel me about your profile how can u tel and where to stop. please help me as simple as possible i am facing lot in this..............plese can anyone help me i am awaiting for your reply.

1 Answers   TCS,


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?

0 Answers  


what is the use of asp.net

3 Answers   ABC,


What are the asp.net 2.0 features?

0 Answers  






Explain the difference between webfarm and webgardens in .net?

0 Answers  


What is autopostback in asp net?

0 Answers  


What are the session management techniques asp net?

0 Answers  


How to prevent client side validation from the ASP.NET validation controls?

0 Answers   Viscus Infotech,


What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC

0 Answers  


How can we Maintain more than on config file in one .Net web application and how?

1 Answers   USi,


Explain how inline and code behind is used differently ?

1 Answers   Siebel,


Categories