This is a migrated thread and some comments may be shown as answers.

Tab Strip and update status

2 Answers 87 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
usr9999
Top achievements
Rank 1
usr9999 asked on 01 Aug 2010, 10:25 PM
Hi,

   I need to be able to check the status and prompt the user for save when the user is moving out of the current tab. I have lot of controls under each tab. Is there any way or property that can give me if the user has updated and has unsaved data. 

Thanks in advance. 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Aug 2010, 02:27 PM
Hello,

I guess you want to show confirm, when changing tab if the dat is not saved for the current tab. If so make use of client side event 'OnClientTabSelecting' and cancel the event using args.set_cancel(true) based on condition which is data saved or not.

Place one HiddenField on page and reset the value when saving the data, and then you can easily check that from client side whether user has saved it or not.


-Shinu.
0
usr9999
Top achievements
Rank 1
answered on 03 Aug 2010, 03:51 PM
Thank you very much for the quick reply.

I have tried but have the following issue.

I have a hidden field. Upon save I am storing the value into the hidden field and am validating against the hidden filed.  This part works fine.

 If user just opens the tab but don’t change any data and want to move out of the record. I should not prompt the user for saving as the data has not been changed.

As I have lot of data elements on each record, I was trying to find out if I can know this by any property instead of using java script for each element to check if the data is actually saved.

Thank you,

Tags
TabStrip
Asked by
usr9999
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
usr9999
Top achievements
Rank 1
Share this question
or