Home All Groups Group Topic Archive Search About

Use IsPostBack for more than one roundtrip

Author
23 Jul 2005 10:19 AM
AndiRudi
Hi, i am trying to build a wizard control and return to a problem, that I
often get and I wasn't able to solve it so far...

If I habe a Custom Control which uses more than one roundtrip, e.g. a wizard
control with more pages and the next/back Buttons are LinkButtons, I cannot
decide what state the page has.

Think of a "Import" Wizard. Page 1 loads up the csv File. Page 2 dynamically
shows dropdowns of the headlines of the table in the csv and allows the user
to assign his fields on the target table...

Page 1 is easy, the Next Button loads up the file und shows the user the
next page (which is a panel). At this moment, i should dynamically create the
dropdowns. This can be done in the Next_Click Handler for example. But then,
the User selects his field combinations. Each Drop is AutoPostBack=true. He
selectes the first field. Now the Problem is that we have another Event...
(dropdown_selected...) and not Next_Click and there is no way to build the
dropdowns again.

I cannot do this in Page_Load because, the Next-Click event fires after
Page_Load...

Any suggestions?

Author
25 Jul 2005 5:38 PM
Harolds
Override the LoadViewState of the page, and build/rebuild the controls there
when needed.

  Protected Overrides Sub LoadViewState(ByVal savedState As Object)
    MyBase.LoadViewState(savedState)
    if viewstate("LoadControls") & "" = "true" then
      CallLoadControls
    End if
  End Sub

Show quoteHide quote
"AndiRudi" wrote:

> Hi, i am trying to build a wizard control and return to a problem, that I
> often get and I wasn't able to solve it so far...
>
> If I habe a Custom Control which uses more than one roundtrip, e.g. a wizard
> control with more pages and the next/back Buttons are LinkButtons, I cannot
> decide what state the page has.
>
> Think of a "Import" Wizard. Page 1 loads up the csv File. Page 2 dynamically
> shows dropdowns of the headlines of the table in the csv and allows the user
> to assign his fields on the target table...
>
> Page 1 is easy, the Next Button loads up the file und shows the user the
> next page (which is a panel). At this moment, i should dynamically create the
> dropdowns. This can be done in the Next_Click Handler for example. But then,
> the User selects his field combinations. Each Drop is AutoPostBack=true. He
> selectes the first field. Now the Problem is that we have another Event...
> (dropdown_selected...) and not Next_Click and there is no way to build the
> dropdowns again.
>
> I cannot do this in Page_Load because, the Next-Click event fires after
> Page_Load...
>
> Any suggestions?