我想让SideBar函数更像Prev/Next按钮。导航按钮仅在向前移动时检查验证;他们不在乎你是否回去。据我所知,你只能在SideBar上有一个或另一个选项,而不是两个。所以,在这里就是我一直试图做的事:asp:向导SideBarTemplate - 动态CausesValidation导致Page.IsValid错误
<SideBarTemplate>
<asp:DataList ID="SideBarList" runat="server">
<ItemTemplate>
<asp:LinkButton ID="SideBarButton" runat="server" CausesValidation="<%# Container.ItemIndex >= myWizard.ActiveStepIndex %>" />
</ItemTemplate>
</asp:DataList>
</SideBarTemplate>
它工作向前发展,但与此错误失败,以前的步骤:
Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control that has CausesValidation=True and initiated the postback, or after a call to Page.Validate.
有什么建议?
编辑:我确实看过this post,但它似乎没有解决问题。