Solved

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

Posted on 2009-05-12
5
211 Views
Last Modified: 2012-05-06
I want to display in ajax asp.net a save message saying saving new ticket id..
0
Comment
Question by:mathieu_cupryk
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24365397
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...
0
 

Author Comment

by:mathieu_cupryk
ID: 24365419
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
0
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24365452
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 ;-)
0
 

Author Comment

by:mathieu_cupryk
ID: 24365499
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");
                }

            }

        }
0
 
LVL 10

Accepted Solution

by:
MaxOvrdrv2 earned 500 total points
ID: 24365750
Nice... all in C#... oki doki... it's always fun to work with C#... extremely confusing for no reason what so ever... but fun... i guess...

IMPORTANT NOTE: the ampersand in the below refers to VBNet code that appends the object's content (as string) to the string currently being built... in C# it might be "+" and not "&"... you should know that however... i just totally dispise C# so i'm not super familiar with the common stuff...
else
{
    Response.Write("<script type=""JavaScript"">confirm(""Your ticket has been created.\n\nHere is your Ticket ID:\n" & ticket.TicketID.ToString() & "\n\n\Write it down for future reference.""); window.location.href=""CompanyTickets.aspx"";</script>");
}

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question