Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters
Message
 
To
07/08/2003 22:58:40
Jacci Adams
Lindsay-Adams Consulting
Louisville, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00818061
Message ID:
00819158
Views:
11
Page controls are actually classes, so the easiest way to do this probably is to implement properties on the control which can be set from the parent. THis is generally more appropriate than setting Session variables, which require a significant (comparitively) amount of overhead as there's always boxing involved as well as writing and retrieving from the Session store (especially if it's not an InProc session store such as the StateServer or SQL Server one of which should always be used with ASP.Net IMHO).

Note that page controls by default aren't added to the Form as properties like other controls, so you may have to manually perform this step after dropping the custom control on the Web form. Just add the property like the other page controls. After that you can reference it from teh main form with

this.MyPageControl.Property


+++ Rick ---


>Hi All,
>
>I'm designing a web form that has a user defined control (ascx) on it. This ascx needs values from parent container controls. How do I pass values to the child ascx? I need these values when the ascx's Save button is clicked. I don't know if session variables would be appropriate or not?
>
>Thanks,
>Jacci
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform