Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to use multiple scriptmanager controls in a web page?

1102


What’s difference between “optimistic” and “pessimistic” locking?

1066


What is cache in asp net?

995


What is the difference between CC and BCC?

1061


What is data cache in sql server?

1112


What is the behavior of a Web browser when it receives an invalid element?

1109


How do I create a web form?

1036


What are validator? Name the validation controls in asp.net? How do you disable them?

1035


What is ASLM?

1116


What is the difference between localization and globalization?

1029


What are the disadvantages of view state?

1101


How would you enable impersonation in the web.config file?

994


What is form method?

924


How information about the user's locale can be accessed?

1058


What are the different types of Caching techniques in ASP.NET?

1053