I'll make a sample app tomorrow, but basically what I am doing is something like this:
... OnClick(...)
{
if(myWebService.HasErrors(formdata))
myBtn.Visible = true;
else
{
myBtn.visible = false;
multiview.ActiveIndex++;
}
}
So when I click the button the following happens:
I check a Webservice to see if the users has any error in the form data
->if errors then I show a error message explaining what fields must be corrected
->no error then I move to the next view
Works great without updatepanels, but then I use updatepanels then the viewindex isn't changed. But it changes if I click the button twice.
If this doesn't make any sense then I'll make a small sample app and see if I can reproduce the behavior.
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
...
</asp:view>
<asp:View ID="View2" runat="server">
<asp:UpdatePanel ID="pnlMeldinger" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:label id="mybtn" runat="server" visible="false" text="Please correct input">
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnOK" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="btnOK" runat="server" Text="Send" OnClick="btnOK_Click" />
<asp:UpdateProgress ID="progress" runat="server">
<ProgressTemplate>
<asp:Label ID="lblProgress" runat="server" Text="BUSY" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:view>
<asp:View ID="lastView" runat="server">
</asp:view>
</asp:MultiView>