I found the following example of a webhandler to add pushpins to a map. could you please tell me what i need to save to my database in order to make it run and which line i need to modify
<%@ WebHandler Language="C#" %>
using System;
using System.Web;
public class geo : IHttpHandler {
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/xml";
georgeuk
Member
5 Points
43 Posts
web handler
Jan 07, 2010 08:09 PM|LINK
I found the following example of a webhandler to add pushpins to a map. could you please tell me what i need to save to my database in order to make it run and which line i need to modify
<%@ WebHandler Language="C#" %>
using System;
using System.Web;
public class geo : IHttpHandler {
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/xml";
XmlTextWriter writer = new XmlTextWriter(context.Response.OutputStream, null);
writer.WriteStartDocument();
writer.WriteStartElement("rss");
writer.WriteAttributeString("version", "2.0");
writer.WriteAttributeString("xmlns:geo", "http://www.w3.org/2003/01/geo/wgs84_pos#");
writer.WriteStartElement("channel");
foreach (ScheduleItem item in TSSContext.SchedulePlanner.ScheduleItems)
{
// collection address
writer.WriteStartElement("item");
writer.WriteElementString("title", item.CollectionAddress.Name);
writer.WriteElementString("description", item.CollectionAddress.PostTown);
writer.WriteElementString("geo:lat", item.CollectionAddress.Latitude.ToString());
writer.WriteElementString("geo:long", item.CollectionAddress.Longitude.ToString());
writer.WriteEndElement();
//delivery address
writer.WriteStartElement("item");
writer.WriteElementString("title", item.DeliveryAddress.Name);
writer.WriteElementString("description", item.DeliveryAddress.PostTown);
writer.WriteElementString("geo:lat", item.DeliveryAddress.Latitude.ToString());
writer.WriteElementString("geo:long", item.DeliveryAddress.Longitude.ToString());
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
}
public bool IsReusable {
get {
return false;
}
}
}