Button click confirmation *after* executing part of click handler

wiifree.de

New Member
I have two dropdown lists, one for a list of employees and one for a list of teams; when a button is clicked the selected employee should be assigned (or re-assigned if they are already assigned to another team) to the selected team. In the case that the employee is already assigned to another team (in other words they are being reassigned), I'd like to check whether they are the only remaining member of the team they are currently assigned to. If so, I'd like to prompt the user with something like 'Reassigning this member will cause x team to be empty/removed, are you sure you want to do this?'. I know I could do something like this: \[code\]<asp:Button OnClientClick="return confirm('Are you sure you want to go?');" Text="Confirm" runat="server" onclick="Unnamed1_Click" /> \[/code\]But as I understand it, this will cause the prompt to be shown immediately upon the button's click, and isn't dependent on the precondition of the team member being the only remaining member of their current team. Is there any way I can cause a prompt to be shown conditionally, after executing the previously mentioned checks?Thanks,
Chris
 
Back
Top