Skip to main content

Posts

Showing posts with the label runtime coding for sitemap (How to create sitemap runtime in asp.net code for sitemap in asp.net sitemap coding dot net sitemap runtime dynamic sitemap in dot net

How to create sitemap runtime in asp.net

How to create sitemap runtime in asp.net // begin program abc // declare namespace using System.Xml; using System.Text; using System.Data.SqlClient; //declare class public partial class sitemap : System.Web.UI.Page { SqlConnection cn; protected void Page_Load(object sender, EventArgs e) { try { cn = new SqlConnection("Your connection string"); string mydomain = "your domain name"; string strSql = "select abc from test"; SqlDataAdapter dacontent = new SqlDataAdapter(strSql, cn); DataSet dscontent = new DataSet(); dacontent.Fill(dsd, "SiteMap"); //Now we are going to create XML file using XMLTextWriter XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("urlset", "url"); writer.Writ...