Link to home
Start Free TrialLog in
Avatar of Michael Sterling
Michael SterlingFlag for United States of America

asked on

How do I create a popup box for my wizard control?

I have a wizard control and am needed to create a popup box (dialog) that, depending on which option the user chooses, will either allow the code to continue to execute or stop/prevent the remaining code within the onclick event from continuing to execute. My problem is that the onfinishbuttonclick event for the wizard is already being used to do some things and I'm not sure how to work a popup dialog within the event. Any ideas or examples would be appreciated. Thank you.

current HTML
                                    <asp:Wizard ID="wzInspection" runat="server" BackColor="#EFF3FB" 
	                                    bordercolor="#B5C7DE" BorderWidth="1px" DisplaySideBar="false" 
	                                    Font-Names="Verdana" Font-Size="0.8em" Headertext="" 
	                                    Height="638px" Width="865px" onactivestepchanged="wzInspection_ActiveStepChanged" 
	                                    onfinishbuttonclick="wzInspection_FinishButtonClick" 
                                        FinishCompleteButtontext="Complete" FinishCompleteButtonStyle-ForeColor="Blue"
	                                    onnextbuttonclick="wzInspection_NextButtonClick" 
	                                    onpreviousbuttonclick="wzInspection_PreviousButtonClick"
                                        OnCancelButtonClick="wzInspection_OnCancelButtonClick"
                                        displaycancelbutton="true" 
                                        ActiveStepIndex="0" >

Open in new window


current C# code
        protected void wzInspection_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            // this is the Complete button on the Misc step
            bool bWeGood = true;

            FinalValidation();

            if (Session["InspectionAccepted"].ToString() == "F" && Session["ReadOnly"].ToString() != "1") //SECURITY
            {
                string InspDateToUpdate = string.Empty;

                if (txtInspectionDT.Text == "")
                {
                    InspDateToUpdate = "ISPDT1";
                    txtInspectionDT.Text = ArrowGlobalFunc.convertDateToInt(DateTime.Now.ToShortDateString());
                }
                else if (txtInspectionDT2.Text == "")
                {
                    InspDateToUpdate = "ISPDT2";
                    txtInspectionDT2.Text = ArrowGlobalFunc.convertDateToInt(DateTime.Now.ToShortDateString());
                }
                else
                {
                    InspDateToUpdate = "ISPDT3";
                    txtInspectionDT3.Text = ArrowGlobalFunc.convertDateToInt(DateTime.Now.ToShortDateString());
                }

                if (saveInspection(int.Parse(Session["ActiveInspectionPage"].ToString()))) // save the items on the step
                {
                    ArrowGlobalFuncWebCtrls.saveInspection(InspDateToUpdate); // save dates

                    ////Set Dekra Approve DT to 0
                    //string sSQL = "UPDATE " + Session["Library"].ToString() + ".INSPECTION SET ISPTRSAPDT = 0 WHERE ISPNUM = " + Session["ISPNUM"].ToString();
                    //ArrowGlobalFunc.updateDB(sSQL);

                    lblSaveSuccess.Text = "The Inspection has been saved and Notification emails have been sent";
                    lblSaveSuccess.Visible = true;
                    btnAddInspection.Visible = true;
                    btnHome.Visible = true;
                    lblCompleteWarning.Visible = false;

                    wzInspection.FinishCompleteButtonStyle.CssClass = "hideme";

                    LockInspection();

                    Email smtpMail = new Email();
                    StringBuilder emailBody = new StringBuilder();
                    emailBody.Append("<b>Inspection entered or Re-inspection!</b><br><br>");
                    emailBody.Append("Vin: " + txtFullVin.Text.Trim() + "<br>");
                    emailBody.Append("Fleet: " + txtFleet.Text.Trim() + "<br>");
                    emailBody.Append("City: " + txtCity.Text.Trim() + "<br>");
                    emailBody.Append("Location: " + txtLocation.Text.Trim() + "<br>");
                    emailBody.Append("Unit: " + txtUnit.Text.Trim() + "<br>");
                    emailBody.Append("Insp Co: " + Session["uCompName"].ToString() + "<br>");
                    emailBody.Append("Inspector: " + ArrowGlobalFuncWebCtrls.GetInspectorName(int.Parse(Session["uID"].ToString())) + "<br><br>");
                    emailBody.Append("<b>NOTE:</b> This is an automated email. Please do not reply.");

                    string CompIDs = string.Empty;
                    switch (Session["ISPCOMPID"].ToString())
                    {
                        case "1":
                            CompIDs = "1";
                            break;
                        case "2":
                            CompIDs = "2";
                            break;
                        case "3":
                            CompIDs = "3";
                            break;
                    }

                    smtpMail.SendMail(FROM_MAIL, ArrowGlobalFunc.GetEmailAddressesWithMgrs(CompIDs, Session["uID"].ToString()), ISP_COMPLETE, emailBody.ToString(), ArrowStrings.strSMTPserver, ArrowStrings.strSMTPuser, ArrowStrings.strSMTPpwd);
                }
                else
                {
                    sFinalValidationErrMsg = "<br/><br/>There was an error saving the data. ";
                    bWeGood = false;
                }
            }
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Michael Sterling
Michael Sterling
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Sterling

ASKER

Solved by doing my own research.