using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net.Mail; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Xml; public partial class product : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Xmldata(); } } private void Xmldata() { try { int txt = 1, img = 1, imgA = 1, imgS = 1, b = 1, bt = 1, bb = 1, a = 1, c = 1, h = 1, at = 1, hp = 1, imgH = 1, pdf = 1, bpdf = 1; string temp = "", temp1 = "", temp2 = ""; XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath("xml/sample.xml")); XmlNodeList nodelist = doc.SelectNodes("root/*"); foreach (XmlNode node in nodelist) { if (node.Attributes[0].InnerText.ToLower().Equals("p0")) { XmlNodeList nodelist2 = node.ChildNodes; b1.InnerHtml = node.ChildNodes[0].InnerText; b2.InnerHtml = node.ChildNodes[1].InnerText; b2.Attributes.Add("href", "mailto:" + node.ChildNodes[1].InnerText.Replace(" ", "")); b7.InnerHtml = node.ChildNodes[9].InnerText; b8.InnerHtml = node.ChildNodes[10].InnerText; b9.InnerHtml = node.ChildNodes[11].InnerText; b9.Attributes.Add("href", "tel:" + node.ChildNodes[11].InnerText.Replace(" ", "")); b10.InnerHtml = node.ChildNodes[12].InnerText; b10.Attributes.Add("href", "mailto:" + node.ChildNodes[12].InnerText.Replace(" ", "")); } else if (node.Attributes[0].InnerText.ToLower().Equals("p3")) { XmlNodeList nodelist2 = node.ChildNodes; foreach (XmlNode node1 in nodelist2) { if (node1.Name.Contains("txt")) { temp1 = "p" + bt; HtmlGenericControl htmg = (HtmlGenericControl)form2.FindControl(temp1); htmg.InnerHtml = node1.InnerText; bt++; } else if (node1.Name.Contains("t")) { temp1 = "p" + bt; HtmlGenericControl htmg = (HtmlGenericControl)form2.FindControl(temp1); htmg.InnerHtml = node1.InnerText; bt++; } else if (node1.Name.Contains("img")) { temp1 = "img" + img; HtmlImage image = (HtmlImage)form2.FindControl(temp1); image.Src = node1.InnerText; img++; } } } } } catch { } } protected void btnsubscribe_click(object sender, EventArgs e) { try { SendMail(); Session["Subscribed"] = "Yes"; //this.ClientScript.RegisterStartupScript(this.GetType(), "", "