"confirm" dialog before processing dropdown event
I'm trying to get a confirm dialog box to fire before processing a dropdownbox 'onselectedindexchange' event.
I have a dropdownbox:
<asp:DropDownList ID="drpSelAction" Runat="server" OnSelectedIndexChanged="drpSelAction_SelectedIndex Changed" AutoPostBack="True">
<asp:ListItem Text="Select Action..." Value="" />
<asp:ListItem Text="" Value="" />
<asp:ListItem Value="Edit Move Project" />
<asp:ListItem Text="" Value="" />
<asp:ListItem Value="Add Employees To Move">
</asp:ListItem>
<asp:ListItem Text="" Value="" />
<asp:ListItem Value="Delete Selected Employee Moves" />
<asp:ListItem Value="Cancel Selected Employee Moves" />
<asp:ListItem Value="Reactivate Selected Employee Moves" />
</asp:DropDownList>
If the user selects "Delete Selected Employee Moves" I would like to have the drpSelAction_SelectedIndexChanged in the code-behind page prompt the user to confirm that they want to delete.
Here's the event code:
public void drpSelAction_SelectedIndexChanged(object sender, EventArgs e)
{
switch (drpSelAction.SelectedValue)
{
case "Delete Employees":
delSelectedMoves();
break;
case "Cancel Employee Moves":
cnclSelectedMoves();
break;
case "Uncancel Employee Moves":
uncnclSelectedMoves();
break;
default:
break;
}
drpSelAction.SelectedIndex = 0;
}
So before this kicks off - i need to get a confirmation dialog to come up.
Any help would be appreciated.
Thanks.
GREG LANDGRAF
APPLICATION EXPERT
Computerized Facility Integration (CFI)
20 N Wacker Drive, Suite 2600, Chicago, IL 60601
OFFICE: 312.236.2323 x 6854
MOBILE: 847.721.3027
FAX: &nbs p;312.236.2336
EMAIL: glandgraf@gocfi.com
Facilities Technology - Better, Faster and Cheaper!
|