I am trying to output xml on my aspx page. But it returns no result.
The aspx page:
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Sitemap.aspx.cs"
Inherits="Servicebyen.Presentation.Web.Sitemap" %>
The code behinde:
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "text/xml";
var writer = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
writer.Settings.CloseOutput = false;
writer.WriteStartDocument();
writer.WriteStartElement("urlset");
writer.WriteAttributeString("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9");
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
writer.Close();
Response.End();
}
Can you see anything wrong with this?