Switching View inside MultiView control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexander van Doormalen

    Switching View inside MultiView control

    I have a MultiView control with 2 Views in it. In the first View I have
    a form which contains sereral input controls and a custom UserControl.
    In this custom UserControl I have a button which causes a postback.
    When the click event gets handled I am grabbing the MultiView instance
    from a parent control (using a recusive method).

    When i change the active View on this MultiView control nothing
    happens. The second time you click the button a a error message pops up
    saying the viewstate is invalid. I think this happens because the
    MultiView is done loading and setting a new active view doesn't cause a
    'reload'. How can I force a reload of this MultiView control so the new
    active View will be visible instead of the current View?

    I tried the databind method on the MultiView but that doesn't change
    the output. Also using an event based approach doesn't work. Any
    thoughts?

    Thnx in advance

  • Alexander van Doormalen

    #2
    Re: Switching View inside MultiView control

    I'm really stuck with this atm. Does anybody have some
    suggestions,rem arks etc.

    Comment

    • Alexander van Doormalen

      #3
      Re: Switching View inside MultiView control

      Solved it myself. The problem occured because I used Atlas and a custom
      control which hadn't got a a container element with the control id as
      attribute. What happened was that Atlas tried to update the control in
      another update panel which corrupted the viewstate and didn't show up
      the screen.

      The container element is default a span element in ASP.net. Since a
      span elements around a table isnot valid html I overrided
      RenderBeginTag and RenderEndTag and left the methods empty so no span
      was generated. Solved this by overriding only the RenderBeginTag and
      rendered a div begin tag.

      Comment

      Working...