Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-12
5
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

715 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