I'm a new programmer trying to understand someone else's code. The program's purpose is to put MySQL data into a word file template using bookmarks. AR and ICN are 2 types of reports, thus they each have their own template. The code was originally containing only AR's, I have now added ICN. The console application works well, I have problems with the Web page. I don't understand why the \[code\]if (int.TryParse(ticketId, out currentTicket))\[/code\] in my code is \[code\]FALSE\[/code\] which generates a default.aspx .Trying to view in broswer this code\[code\]using System;using System.Web;using TicketExtractionLibrary;namespace TicketExtractionWeb{ public partial class GetAR : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string ticketId = Request.QueryString["TicketId"]; int currentTicket; string applicationPath = Request.PhysicalApplicationPath; ARExtractionController ARController = new ARExtractionController(); string arTemplateLocation = HttpContext.Current.Server.MapPath("~/AR.dot"); string mappingLocation = HttpContext.Current.Server.MapPath("~/ARmapping.xml"); if (int.TryParse(ticketId, out currentTicket)) { ARController.Extract(currentTicket, applicationPath + "LastTickets", arTemplateLocation, mappingLocation); Response.Clear(); Response.Buffer = true; Response.ContentType = "application/msword"; Response.AddHeader("content-transfer-encoding", "binary"); Response.AddHeader("content-disposition", "attachment;filename=AR" + ticketId + ".docx"); Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251); string path = Server.MapPath(@"\LastTickets\AR" + ticketId + ".docx"); System.IO.FileInfo file = new System.IO.FileInfo(path); Response.WriteFile(path); Response.End(); } else { Response.Redirect("Default.aspx"); } } }}\[/code\]
