dynamic controls with wired-up event

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
 
R

Robbe Morris [C# MVP]

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
 
B

BillE

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top