• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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" 
                                        FinishCompleteButtontext="Complete" FinishCompleteButtonStyle-ForeColor="Blue"
                                        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;


            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());
                    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();

                    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";


                    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";
                        case "2":
                            CompIDs = "2";
                        case "3":
                            CompIDs = "3";

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

Open in new window

Michael Sterling
Michael Sterling
  • 2
1 Solution
Michael SterlingWeb Applications DeveloperAuthor Commented:
Figured it out! I was looking in the wrong place, I should've been looking at how to manipulate the existing buttons of the wizard to make them do what I wanted them to do:

            Button b = (Button)wzInspection.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton");
            if (b != null)
                b.OnClientClick = "return confirm('WARNING!!...ONLY DO THIS IF YOU REALLY MEAN IT!!!')";
Michael SterlingWeb Applications DeveloperAuthor Commented:
Solved by doing my own research.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now