Solved

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

Posted on 2009-05-12
5
180 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now