I'm currently building a small website that takes data from 6 different web forms written in ASP.NET and C#. I need all of the information to be written to a PDF at the end of Page 6. I currently have all fields mapped, but each time the page changes, the information gets wiped. i have the information set to pass the values using a query string, but it seems to keep getting lost. Any advice?
EDIT Sorry for not posting the code the first time, this is my first question i ever posted here. Also, I know my code isn't very efficient, I'm more or less trying to get the grasp of iTextSharp and WebForms. Thanks
Page 1
AcroFields af = ps.AcroFields;
af.SetField("Name", name.Text);
af.SetField("Email", email.Text);
af.SetField("state", state.Text);
af.SetField("city", city.Text);
af.SetField("Address", address.Text);
af.SetField("Phone", phone.Text);
af.SetField("zip", zip.Text);
Response.Redirect("Default.aspx?name=" + this.name.Text + "&Email=" + this.email.Text
+ "&state=" + this.state.Text + "&city=" + this.city.Text + "&Address=" + this.address.Text +
"&Phone=" + this.phone.Text + "&zip=" + this.zip.Text);
Response.Redirect("Page2.aspx");
Page 2
AcroFields af = ps.AcroFields;
af.SetField("Degree", degree.Text);
af.SetField("Grad", gradDate.Text);
af.SetField("Obj", objective.Text);
Response.Redirect("Default.aspx?Degree=" + this.degree.Text + "&Grad=" + this.gradDate.Text
+ "&Obj=" + this.objective.Text);
Response.Redirect("Page3.aspx");
//ps.FormFlattening = true;
Page 3
AcroFields af = ps.AcroFields;
af.SetField("jobStart1", jobStart1.Text);
af.SetField("jobEnd1", jobEnd1.Text);
af.SetField("jobTitle1", jobTitle1.Text);
af.SetField("coName1", coName1.Text);
af.SetField("coAdd1", coAdd1.Text);
af.SetField("Details1", details1.Text);
Response.Redirect("Default.aspx?jobStart1" + this.jobStart1.Text + "&jobEnd1=" + this.jobEnd1.Text
+ "&jobTitle1=" + this.jobTitle1.Text + "&coName1=" + this.coName1.Text + "&coAdd1=" + this.coAdd1.Text +
"&Details1=" + this.details1.Text);
Response.Redirect("Page4.aspx");
Page 4
AcroFields af = ps.AcroFields;
af.SetField("jobStart2", jobStart2.Text);
af.SetField("jobEnd2", jobEnd2.Text);
af.SetField("jobTitle2", jobTitle2.Text);
af.SetField("coName2", coName2.Text);
af.SetField("coAdd2", coAdd2.Text);
af.SetField("Details2", details2.Text);
Response.Redirect("Default.aspx?jobStart2" + this.jobStart2.Text + "&jobEnd2=" + this.jobEnd2.Text
+ "&jobTitle2=" + this.jobTitle2.Text + "&coName2=" + this.coName2.Text + "&coAdd2=" + this.coAdd2.Text +
"&Details2=" + this.details2.Text);
Response.Redirect("Page5.aspx");
Page 5
AcroFields af = ps.AcroFields;
af.SetField("jobStart3", jobStart3.Text);
af.SetField("jobEnd3", jobEnd3.Text);
af.SetField("jobTitle3", jobTitle3.Text);
af.SetField("coName3", coName3.Text);
af.SetField("coAdd3", coAdd3.Text);
af.SetField("Details3", details3.Text);
Response.Redirect("Default.aspx?jobStart3" + this.jobStart3.Text + "&jobEnd3=" + this.jobEnd3.Text
+ "&jobTitle3=" + this.jobTitle3.Text + "&coName3=" + this.coName3.Text + "&coAdd3=" + this.coAdd3.Text +
"&Details3=" + this.details3.Text);
Response.Redirect("Page6.aspx");
Page 6
string name = Request.QueryString["Name"];
string address = Request.QueryString["Address"];
string phone = Request.QueryString["Phone"];
string email = Request.QueryString["Email"];
string city = Request.QueryString["city"];
string state = Request.QueryString["state"];
string zip = Request.QueryString["zip"];
string degree = Request.QueryString["Degree"];
string gradDate = Request.QueryString["Grad"];
string objective = Request.QueryString["Obj"];
string jobStart1 = Request.QueryString["jobStart1"];
string jobEnd1 = Request.QueryString["jobEnd1"];
string jobTitle1 = Request.QueryString["jobTitle1"];
string coName1 = Request.QueryString["coName1"];
string coAdd1 = Request.QueryString["coAdd1"];
string details1 = Request.QueryString["Details1"];
string jobStart2 = Request.QueryString["jobStart2"];
string jobEnd2 = Request.QueryString["jobEnd2"];
string jobTitle2 = Request.QueryString["jobTitle2"];
string coName2 = Request.QueryString["coName2"];
string coAdd2 = Request.QueryString["coAdd2"];
string details2 = Request.QueryString["Details2"];
string jobStart3 = Request.QueryString["jobStart3"];
string jobEnd3 = Request.QueryString["jobEnd3"];
string jobTitle3 = Request.QueryString["jobTitle3"];
string coName3 = Request.QueryString["coName3"];
string coAdd3 = Request.QueryString["coAdd3"];
string details3 = Request.QueryString["Details3"];
AcroFields af = ps.AcroFields;
af.SetField("Name", name);
af.SetField("Email", email);
af.SetField("state", state);
af.SetField("city", city);
af.SetField("Address", address);
af.SetField("Phone", phone);
af.SetField("zip", zip);
af.SetField("Degree", degree);
af.SetField("Grad", gradDate);
af.SetField("Obj", objective);
af.SetField("jobStart1", jobStart1);
af.SetField("jobEnd1", jobEnd1);
af.SetField("jobTitle1", jobTitle1);
af.SetField("coName1", coName1);
af.SetField("coAdd1", coAdd1);
af.SetField("Details1", details1);
af.SetField("jobStart2", jobStart2);
af.SetField("jobEnd2", jobEnd2);
af.SetField("jobTitle2", jobTitle2);
af.SetField("coName2", coName2);
af.SetField("coAdd2", coAdd2);
af.SetField("Details2", details2);
af.SetField("jobStart3", jobStart3);
af.SetField("jobEnd3", jobEnd3);
af.SetField("jobTitle3", jobTitle3);
af.SetField("coName3", coName3);
af.SetField("coAdd3", coAdd3);
af.SetField("Details3", details3);
af.SetField("Skills", skills.Text);
ps.FormFlattening = true;
}
Response.End();