views:

672

answers:

1

I have two updatePanels

  • UpdatePanel1 contains a button
  • UpdatePanel2 is inside a Multiview View1:

.

<Multiview>
  <View1>
    <UpdatePanel2>
    </UpdatePanel2>
  </View1>
</Multiview>

Multiview ActiveIndex is set to -1.

Now I have attached an AsyncPostBackTrigger on UpdatePanel2 which is associated with the button click.

I want to show View1 when I click the button in UpdatePanel1.

+1  A: 

You're going to need to put the update panel around the MultiView, rather than inside View1:

<UpdatePanel2><MultiView><View1></View1></MultiView></UpdatePanel2>

An UpdatePanel will render on the page as either a div or a span (a div by default).

When you do a callback (such as when you click the button inside the UpdatePanel), ASP.NET sends a message to the browser telling it how to update the contents of the divs that represent your UpdatePanels. This message is received and handled in javascript.

If you're not showing View1 when you first arrive at the page, then UpdatePanel2 won't get rendered at all. Therefore, when your button click causes the callback, there's no div on the rendered page for javascript to change the contents of.

teedyay

related questions