Hi micha_b83, thanks for your response. I tried your suggestion and it indeed solves the problem but it also defeats the purpose of using AJAX for the tabs since the AutoPostBack will refresh the whole page. How do I do solve this while still using AJAX?
Hi, I posted the code in my first post of the threat. Basically I want to be able to use the tab control in AJAX update mode (OnDemand=True) while not having it trigger validators when the tab is selected for the first time. I hope that helps.
Hi micha_b83, that indeed solves the problem although it does significantly slow down the page since it has to load twice, nevertheless, it works. I do hope though that the bug with the tabs in ondemand mode gets addressed so we don't need these work arounds.
Thank you for your help!
micha_b83
Member
18 Points
4 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 26, 2012 01:59 PM|LINK
Hi dtromp,
you must set the Autopost of the Tabcontainer on true
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" ondemand="True" AutoPostBack="true">dtromp
Member
78 Points
116 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 27, 2012 01:59 AM|LINK
Hi micha_b83, thanks for your response. I tried your suggestion and it indeed solves the problem but it also defeats the purpose of using AJAX for the tabs since the AutoPostBack will refresh the whole page. How do I do solve this while still using AJAX?
micha_b83
Member
18 Points
4 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 27, 2012 10:14 AM|LINK
Hi dtromp,
add the following code into your Page_Load:
protected void Page_Load(object sender, EventArgs e) { //Do it always also by postback if (!IsPostBack) { //Do anything just one time } }Your TabContainer must be in a UpdatePanel.
dtromp
Member
78 Points
116 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 28, 2012 02:29 AM|LINK
Hi micha_b83, I have similar code to that in my page already, I am not sure what you are getting at.
micha_b83
Member
18 Points
4 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 28, 2012 08:59 AM|LINK
Please post the code and explain more detail about your problem.
dtromp
Member
78 Points
116 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 29, 2012 01:08 AM|LINK
Hi, I posted the code in my first post of the threat. Basically I want to be able to use the tab control in AJAX update mode (OnDemand=True) while not having it trigger validators when the tab is selected for the first time. I hope that helps.
micha_b83
Member
18 Points
4 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 29, 2012 09:46 AM|LINK
I'm not sure if I get your problem. Your Aspx-Site should be (i used your code and append the missing tags):
<body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" ondemand="True" AutoPostBack="true"> <asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1"> </asp:TabPanel> <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2"> </asp:TabPanel> <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" style="margin-bottom: 0px" ValidationGroup="Test"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="TextBox1" ForeColor="Red" ValidationGroup="Test">*</asp:RequiredFieldValidator> <asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="Test" /> </ContentTemplate> </asp:TabPanel> </asp:TabContainer> </ContentTemplate> </asp:UpdatePanel> </form> </body>dtromp
Member
78 Points
116 Posts
Re: TabContainer incorrectly triggers validation when OnDemand is set to True
Mar 31, 2012 05:07 AM|LINK
Hi micha_b83, that indeed solves the problem although it does significantly slow down the page since it has to load twice, nevertheless, it works. I do hope though that the bug with the tabs in ondemand mode gets addressed so we don't need these work arounds. Thank you for your help!