Ramzy N.Ebeid:can i make a new method on the app_code "x" and then call X method from the user control and X call the method i want in the aspx page can i do that and how please.
You can... For example:
You have an aspx page (test.aspx) and a usercontrol inside it (usercontrol.ascx). And you want to call a method of the aspx page from the user control:
- Declare your method as public in the test.aspx's codebehind / public void JustTest( ) { } /
- Now you could call JustTest from anywhere in the usercontrol.ascx codebehind in the following form:
( ( test )this.Page ).JustTest( );
- So the trick is that first you need the usercontrol's page object to cast to the parent page's exact type.
/ If you do it right you get of course intellisense also for ( ( test )this.Page )
/