Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access Form from WebUserControl
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01003596
Message ID:
01003703
Views:
17
Yes. You can but not using Parent.Parent method.

You can store the reference of the Page into a property of UserControl and then refer it to call Page methods. You will have to cast the page property to the page class in order access it's members.

For example,

((myCustomerPage) oPage).MyPageMethod()

where oPage is a property in you usercontrol which stores a reference of myCustomerPage WebForm class.

>Hi all!
>
>I'm creating several WebUserControls (ASCX).
>These ASCX's are later shown in my WebForms (either added dynamically or directly dropped onto them).
>
>Now my question:
>Is it possible to access my WebForm methods (eg: ErrorHandling methods,...) from within my ASCX?
>In VFP I'd say this.parent.parent.mymethod().
>
>TIA
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform