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

1.how to encrpt query string in asp.net? 2.there are 10000 records then i wnat display 5000 records one gridview and 5000 records another grid view what is the process?

2 Answers   Marlabs,


Write the different features of a Thread and a Process?

0 Answers   Siebel,


What do you mean by caching in asp.net?

0 Answers  


Difference between connected architecture and Dissconnected architecture?

2 Answers  


What are the event handlers that can be included in the Global.asax file?

0 Answers   MindCracker,






Where is the view state data stored?

0 Answers  


In which situation can you not use a viewstate?

0 Answers  


Which method is used to perform all validation at the page level?

0 Answers   Sans Pareil IT Services,


How many types of cookies are available in asp?

0 Answers  


You need to be able to retrieve data from DataSet object that has four DataTable objects. There are currently UniqueConstraint and ForeignKeyConstraint Object on the DataTable objects to enforce the data rules. You find that you can retrieve the data from the individual DataTable objects, but you are not able to retrieve the data from the combination of DataTable objects in a Parent/Child manner. What should you do to able to retrieve the data in a Parent/Child manner? a) Set the EnforceParentChild parameter of the DataSet to True. b) Set the EnforceRelation parameter of the Relations collection to True. c) Add DataRelation objects to the Relations Collection to make the DataSet present the data in Parent/Child manner. d) Add a primary key and a foreign key to each of the DataTable objects that should present the data in a Parent/Child manner.

1 Answers   Syntax Softtech,


What is the good practice to implement validations in aspx page?

0 Answers  


What is validationsummary server control? where it is used ?

1 Answers  


Categories