tags:

views:

137

answers:

3

Here's a fun problem. The page in question is wizard like page. here's the scenario-

  1. User clicks on a link button to get to step 2 of the wizard. (The post back can't be avoided. URL based navigation isn't an option.)
  2. User clicks on a radio button/link button/any control that requires a postback for client-server interaction.
  3. The page reloads as if nothing happens.
  4. User repeats step 2. Things work fine.

What I do is this -

I have just one page for all steps of the wizard. Based on the step, the appropiate control is loaded into the page. This control is added to a placeholder control in the OnLoad event. Doing so in OnInit or OnPreRender doesn't work. This step of adding introduces the odd behaviour I've described above.

Any ideas?

A: 

Since you're adding controls to your page at runtime to get the wizard to appear on one page, I think this is a simple matter of rearranging some of your code.

Refer to this article at CodeProject - specifically the section that discusses viewstate and dynamic controls in the section called - "Walkthrough 6: Viewstate and Dynamic Controls".

Erik Westermann
A: 

Very simple, you have to re-add control on each postback, re-attach event handlers and give dynamically loaded control same Id.

epitka
A: 

The application uses a custom control framework. The issue is related to the framework. Had to redesign the approach.

abjbhat