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

Is data edited in the Repeater control?

1083


How to use multiple scriptmanager controls in a web page?

1154


What is difference between View State and Hidden Field in ASP.NET?

1189


How to implement form based authentication in asp.net application?

1174


Which asp.net objects encapsulate the state of the client and the browser?

1150


What is the difference between union and join?

1275


Explain the path instructions in xaml?

1053


What is a user session?

930


What is the difference between the response.write() and response.output.write() methods?

1062


Explain the use of fragment caching.

1155


What is an imagemap in asp.net?

1240


What are HTTP handlers in ASP.NET?

1148


How can we create custom controls in asp net?

1077


Is there any limit for query string? Means what is the maximum size?

1004


How to create discussion forum in asp.net mvc? : Asp.Net MVC

1085