Hi Usha,
For restricting the tab changes in Ajax Tab Panel you can use the following code -
<asp:toolkitscriptmanager id="ToolkitScriptManager1" runat="server" xmlns:asp="#unknown"></asp:toolkitscriptmanager>
<div>
<asp:tabcontainer id="TabContainer1" runat="server" onclientactivetabchanged="validateFormData" xmlns:asp="#unknown">
<asp:tabpanel id="TabPanel1" headertext="Tab 1" runat="server">
<contenttemplate>
<asp:textbox id="TextBox1" runat="server" clientidmode="static" />
</contenttemplate>
</asp:tabpanel>
<asp:tabpanel id="TabPanel2" headertext="Tab 2" runat="server">
<contenttemplate>
</contenttemplate>
</asp:tabpanel>
</asp:tabcontainer>
</div>
And you can include a function in javascript -
<script type="text/javascript">
function validateFormData() {
if ($find("TabContainer1").get_activeTabIndex() == 1)
if($('#TextBox1').val()== "") {
alert('Please add value in textbox first then proceed');
$find("TabContainer1").set_activeTabIndex(0);
}
}
</script>
I hope this helps.
Thanks