Bytes Expert Newtork: Connect with experts in IT / Business | Expert Topics



Search


Go Back   Programmers Resource > Programming Forums > ASP.NET
User Name
Password


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-13-2009, 02:47 PM
urstop urstop is offline
Web App Developer
 
Join Date: Oct 2007
Location: London
Posts: 23
stop tab from changing on click in ASP.NET ajax toolkit

Today I was working with the Tab Container control from Ajax tool kit and I had this requirement of preventing the user from navigating off to a different tab without completing the required fields on the active tab he was in. There is no direct feature in the toolkit that provides this feature. Googling around did not help me much. So, I sat down to write it. And here is code that I came up with that helps us to achive this feature. Not sure if this is the right way, but it does the job.

Quote:
var ref_set_activeTab = null;
var canChangeTab = false;
function PanelClicked(sender, e)
{
var ctrl = sender.get_owner();
if(ref_set_activeTab == null)
ref_set_activeTab = ctrl.set_activeTab;
canChangeTab = doYourValidations();
if(canChangeTab)
ctrl.set_activeTab = ref_set_activeTab;
else
ctrl.set_activeTab = function(obj){};

}
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 08:11 AM.



Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All content Copyright ©1999 - 2010, Programmers Resource, unless otherwise noted.