Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

Ajax want to show save message on screen saving new ticket id....

I want to display in ajax asp.net a save message saying saving new ticket id..
Avatar of MaxOvrdrv2
MaxOvrdrv2

where are you getting your ID from? on the same page or a different page? Ajax should only be used to pull data across pages without causing a refresh.... so if you already have the new ID on the same page... just JavaScript it...
Avatar of mathieu_cupryk

ASKER

from the code behind.
  <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="233px">
                           <p>Are you sure you want to Continue</p>
                           <br />
                           <div align="center">
                              <asp:Button ID="OkButton" runat="server" Text="OK" />
                              <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
                           </div>
                           </asp:Panel>
                        <ajaxToolkit:ModalPopupExtender ID="popup" runat="server"
                                     TargetControlID="LinkButton1"
                                     PopupControlID="Panel1"
                                     BackgroundCssClass="modalBackground"
                                     DropShadow="true"
                                     OkControlID="OkButton"
                                     OnOkScript="onOk()"
                                     CancelControlID="CancelButton" />

Need to setup server control
all this tells me is that you want to run a script called @onOk@ when the user clicks the Ok button of the confirmation message... where are you saving the ticket when they click ok? where do you want the user to be brought to once they see the ticket id? this is only the control to be used, not where/how you're getting the information... on the same page or not? back to my original question ;-)
I need to execute this and get the ticketid
and then display it.
 protected void btnSaveExit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {

                // Instantiate bussiness object
                Ticket ticket = new Ticket();

                ticket.TicketType = uxLookupFieldTicketType1.SelectedText;
                ticket.TicketStatus = uxLookupFieldTicketStatus1.SelectedText;
                ticket.Priority = uxLookupFieldTicketPriority1.SelectedText;
                ticket.ServiceImpact = uxLookupFieldTicketServiceImpact1.SelectedText;
                ticket.RequestType = uxLookupFieldTicketRequestType1.SelectedText;
                ticket.AgentCreated = uxLookupFieldTicketAssignedTo.SelectedText;
                ticket.ContactMethod = uxLookupFieldTicketContactMethod1.SelectedText;
                ticket.LocationSIMs = uxLookupFieldTicketLocationSIMs1.SelectedText;
                ticket.AgentFollowup = uxLookupFieldTicketAgentFolowup1.SelectedText;
       
                ticket.ShortDescription = txtShortDescription.Text;
                ticket.ExternalTicket = txtExternalTicket.Text;
                ticket.TrackIt = txtTrackIt.Text;

                ticket.SolutionNote = txtSolution.Text;
                ticket.ProblemNote = txtProblem.Text;
                ticket.FollowupNote = txtFollowupNotes.Text;
                ticket.ActionNote = txtActionTaken.Text;
                ticket.TicketApplicationType = txtSubmitVia.Text;

                ticket.DateTimeAssigned = this.ParseDateTime(this.txtDateAssigned.Text);
                ticket.DateCreated = this.ParseDateTime(this.lblDateCreated.Text);
                ticket.DateClosed = this.ParseDateTime(this.lblDateClosed.Text);
                ticket.DateLastModified = this.ParseDateTime(this.lblLastUpdate.Text);
                ticket.AgentClosed = this.lblClosedBy.Text;
               
                ItemCreatedResult res = new ItemCreatedResult();
                res = BLL.TicketLogic.InsertTicket(ticket);
                if (res.Code == 1)
                // throw exception
                {
                }
                else
                {
                    Response.Redirect("CompanyTickets.aspx");
                }

            }

        }
ASKER CERTIFIED SOLUTION
Avatar of MaxOvrdrv2
MaxOvrdrv2

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