Solved

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

Posted on 2009-05-12
5
221 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 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: 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to filter by key press ? 6 66
pVarablies are clearing but do not think i am reloading page 1 19
Json and ajax javascript 24 25
dropdownlist in asp.net vb. 3 23
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

759 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