protected void Page_Load(object sender, EventArgs e) { int ID = 0; string strID = Security.Decrypt(Request["id"]); string strTypeID = Request["typeid"]; masterPage = (masterpages_Site)Master; if (!String.IsNullOrEmpty(strID)) { Int32.TryParse(strID, out ID); } try { if (strTypeID == MailUtil.EmailType.Donation.ToString("D")) { DonationDA DA = new DonationDA(); StringBuilder sb = DA.GetEmailBody(ID, Server.MapPath("~/App_Data/DonationEmail.xsl")); litEmailBody.Text += sb.ToString(); pageName = "Donation_Confirmation_Template"; } else if (strTypeID == MailUtil.EmailType.Membership.ToString("D")) { MembershipDA DA = new MembershipDA(); StringBuilder sb = DA.GetEmailBody(ID, Server.MapPath("~/App_Data/MembershipEmail.xsl")); litEmailBody.Text += sb.ToString().Replace("Please keep this email as receipt for your order.", "Please keep this as receipt for your order."); pageName = "Membership_Confirmation_Template"; } else if (strTypeID == MailUtil.EmailType.Volunteer.ToString("D")) { VolunteerDA DA = new VolunteerDA(); StringBuilder sb = DA.GetEmailBody_Test(ID, Server.MapPath("~/App_Data/VolunteerEmail_Test.xsl")); litEmailBody.Text += sb.ToString(); pageName = "Volunteer_Confirmation_Template"; } else if (strTypeID == MailUtil.EmailType.StudentVolunteer.ToString("D")) { StudentVolunteerDA DA = new StudentVolunteerDA(); StringBuilder sb = DA.GetEmailBody_Test(ID, Server.MapPath("~/App_Data/StudentVolunteerEmail_Test.xsl")); litEmailBody.Text += sb.ToString(); pageName = "Volunteer_Confirmation_Template"; } else if (strTypeID == MailUtil.EmailType.Advocacy.ToString("D")) { AdvocacyDA DA = new AdvocacyDA(); StringBuilder sb = DA.GetEmailBody(ID, Server.MapPath("~/App_Data/AdvocacyEmail.xsl")); litEmailBody.Text += sb.ToString(); pageName = "Volunteer_Confirmation_Template"; } else if (strTypeID == MailUtil.EmailType.BigBookSaleVolunteer.ToString("D")) { BigBookSaleVolunteerDA DA = new BigBookSaleVolunteerDA(); StringBuilder sb = DA.GetEmailBody(ID, Server.MapPath("~/App_Data/BigBookSaleVolunteerEmail.xsl")); litEmailBody.Text += sb.ToString(); pageName = "Volunteer_Confirmation_Template"; } } catch (Exception ex) { pageName = ""; litEmailBody.Text = ex.Message; } finally { masterPage.ComponentName = pageName; } }