dynamic controls with wired-up event

  • Thread starter Thread starter BillE
  • Start date Start date
B

BillE

I have a web form which has dynamic controls for order entry, (item
selected, #,etc.) which are wired to an event handler which fires when the
dynamic controls content changes.

These controls have to be recreated on the Page_Init for the events to fire.

The content of the controls is based on the current CustomerID, and the
order data entered is linked to the customerID.

If the user selects a customer, the customer ID needs to be available to the
Page_Init event when the page is posted back.

How can I pass the CustomerID to the Page_Init event? It looks like the
Viewstate isn't available yet on the Page_Init event, and if I use Session
variables then I will have problems if the user ever opens new windows with
Ctrl-N.

I sure would appreciate some input on this one.

Thanks
Bill
 
Hidden form fields are available in the Request collection in that event.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
The hidden form field is available, but in the Page_Init event it contains
the previous value, and in the Page_Load event it contains the current
value.
 
Back
Top