<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>EPiServer</title>
        <link>http://blogs.interakting.co.uk/brad/category/39.aspx</link>
        <description>EPiServer is an ASP.NET based content management system for simple and swift handling of information on intranets, extranets or public Web sites.</description>
        <language>en-GB</language>
        <copyright>Brad</copyright>
        <managingEditor>pbradley@businessdecision.co.uk</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <item>
            <title>Updating EPiServer Version: Login Failed for User ''</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/08/14/updating-episerver-version-login-failed-for-user.aspx</link>
            <description>&lt;p&gt;I've just spent too long trying to upgrade &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt; CMS 5 to SP2 but kept getting the following error:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Login failed &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; user &lt;span style="color: #006080"&gt;''&lt;/span&gt;. The user &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; not associated with a trusted SQL Server connection.&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Turns out the problem was that EPiServerManager was pulling the connection string out of my web.config, but it appears it was ignoring the fact it specified an Integrated/Windows connection and was passing an empty SQL username to the database - hence the empty quote marks above. (cheers for your help &lt;a href="http://blogs.interakting.co.uk/steve/Default.aspx" target="_blank"&gt;Steve&lt;/a&gt;!)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Temporarily change the SQL connection string in the site's web.config to use an SQL username/password, perform the update and change the string back.&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/337.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/08/14/updating-episerver-version-login-failed-for-user.aspx</guid>
            <pubDate>Thu, 14 Aug 2008 14:27:16 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/337.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/08/14/updating-episerver-version-login-failed-for-user.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/337.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer: Dynamic SiteMap.xml generator for Google</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/06/12/EPiServer-Dynamic-SiteMap.xml-generator-for-Google.aspx</link>
            <description>&lt;p&gt;Having stumbled across &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt;'s &lt;a href="http://www.google.com/webmasters/tools" target="_blank"&gt;Webmaster Tools&lt;/a&gt; a while ago it's been in the back of my mind to create a custom HttpHandler to dynamically create a (virtual) SiteMap.xml file that &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; (and other search engines) can use as a reference when spidering my sites.&lt;/p&gt;  &lt;p&gt;I thought I'd share the basic implantation as a starting point. Ideally you'd add a property to each &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt; &lt;em&gt;PageType&lt;/em&gt; page for "change frequency" and "priority" which the sitemap generator would then use, but for this basic version I've simply set the homepage to 1.0 (the maximum priority) with a daily change, and all other pages to 0.6 and weekly.&lt;/p&gt;  &lt;p&gt;First declare the class and the required members:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; SearchEngineSiteMap : IHttpHandler
{
    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IHttpHandler.IsReusable
    {
        get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;; }
    }
    &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; IHttpHandler.ProcessRequest(HttpContext context)
    {
        GenerateSiteMap(context);
    }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next we need to configure the output stream, create an XmlTextWriter and the outer Xml block:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Generate the SiteMap&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="context"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GenerateSiteMap(HttpContext context)
{
    &lt;span style="color: #008000"&gt;//Set the response information&lt;/span&gt;
    context.Response.Expires = -1;
    context.Response.ContentType = &lt;span style="color: #006080"&gt;"application/xml"&lt;/span&gt;;
    Encoding encoding = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; UTF8Encoding();
    context.Response.ContentEncoding = encoding;

    &lt;span style="color: #008000"&gt;//Create an XMLTextWriter to build the XML, passing it the context's outputstream&lt;/span&gt;
    XmlTextWriter xmlTextWriter = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlTextWriter(context.Response.OutputStream, encoding);
    xmlTextWriter.Formatting = Formatting.Indented;
    xmlTextWriter.WriteStartDocument();

    &lt;span style="color: #008000"&gt;//Write the root xml element&lt;/span&gt;
    xmlTextWriter.WriteStartElement(&lt;span style="color: #006080"&gt;"urlset"&lt;/span&gt;);
    xmlTextWriter.WriteStartAttribute(&lt;span style="color: #006080"&gt;"xmlns"&lt;/span&gt;);
    xmlTextWriter.WriteValue(&lt;span style="color: #006080"&gt;"http://www.sitemaps.org/schemas/sitemap/0.9"&lt;/span&gt;);
    xmlTextWriter.WriteEndAttribute();

    &lt;span style="color: #008000"&gt;//Get &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;'s StartPage (not the RootPage!)&lt;/span&gt;
    PageData p = &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;.DataFactory.Instance.GetPage(PageReference.StartPage);

    &lt;span style="color: #008000"&gt;//SiteMaps can only contain unique urls so maintain a list of added urls&lt;/span&gt;
    List&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; alreadyAddedUrls = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;();

    &lt;span style="color: #008000"&gt;//Now call recursive method to populate every published/visible etc page&lt;/span&gt;
    RenderNodesToSiteMap(
        context,
        xmlTextWriter,
        alreadyAddedUrls,
        p);

    &lt;span style="color: #008000"&gt;//Close the root element&lt;/span&gt;
    xmlTextWriter.WriteEndElement();
    &lt;span style="color: #008000"&gt;//end of document&lt;/span&gt;
    xmlTextWriter.WriteEndDocument();
    &lt;span style="color: #008000"&gt;//finally close the XMLTextWriter&lt;/span&gt;
    xmlTextWriter.Close();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Finally we need to add a method that will be recursively called for each published page in the site:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Recursively converts the given page into XML for use in the sitemap.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="context"&amp;gt;Current Context&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="xmlTextWriter"&amp;gt;XMLTextWriter to write give page (p) to&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="alreadyAddedUrls"&amp;gt;List of Urls already added to the SiteMap&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="p"&amp;gt;The page to add to the sitemap&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RenderNodesToSiteMap(
    HttpContext context,
    XmlTextWriter xmlTextWriter,
    List&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; alreadyAddedUrls,
    PageData p)
{
    &lt;span style="color: #008000"&gt;//Make sure the page is published&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PageDataUtilities.IsPagePublished(child))
    {
        &lt;span style="color: #008000"&gt;//Get the page's 'Friendly' URL&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url = PageDataUtilities.GetFriendlyUrl(p, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);

        &lt;span style="color: #008000"&gt;// Make sure this URL is not in the XML already&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!alreadyAddedUrls.Contains(url))
        {
            &lt;span style="color: #008000"&gt;//Add it ready to check later&lt;/span&gt;
            alreadyAddedUrls.Add(url);
            &lt;span style="color: #008000"&gt;//Write the Url element&lt;/span&gt;
            xmlTextWriter.WriteStartElement(&lt;span style="color: #006080"&gt;"url"&lt;/span&gt;);
            &lt;span style="color: #008000"&gt;//Add the location (Url) attribute - making sure its encoded!&lt;/span&gt;
            xmlTextWriter.WriteElementString(&lt;span style="color: #006080"&gt;"loc"&lt;/span&gt;, HttpUtility.HtmlEncode(url));
            &lt;span style="color: #008000"&gt;//Add when it was last modified&lt;/span&gt;
            xmlTextWriter.WriteElementString(
                &lt;span style="color: #006080"&gt;"lastmod"&lt;/span&gt;,
                p.Changed.ToString(&lt;span style="color: #006080"&gt;"u"&lt;/span&gt;, CultureInfo.InvariantCulture).Replace(&lt;span style="color: #006080"&gt;" "&lt;/span&gt;, &lt;span style="color: #006080"&gt;"T"&lt;/span&gt;));
            &lt;span style="color: #008000"&gt;//If its the StartPage set the change frequency to daily&lt;/span&gt;
            &lt;span style="color: #008000"&gt;//and the priority to 1&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (p.PageLink == PageReference.StartPage)
            {
                xmlTextWriter.WriteElementString(
                &lt;span style="color: #006080"&gt;"changefreq"&lt;/span&gt;,
                &lt;span style="color: #006080"&gt;"daily"&lt;/span&gt;);
                xmlTextWriter.WriteElementString(
                    &lt;span style="color: #006080"&gt;"priority"&lt;/span&gt;,
                    &lt;span style="color: #006080"&gt;"1.0"&lt;/span&gt;);
            }
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #008000"&gt;//Otherwise weekly and a lower priority&lt;/span&gt;
            {
                xmlTextWriter.WriteElementString(
                &lt;span style="color: #006080"&gt;"changefreq"&lt;/span&gt;,
                &lt;span style="color: #006080"&gt;"weekly"&lt;/span&gt;);
                xmlTextWriter.WriteElementString(
                 &lt;span style="color: #006080"&gt;"priority"&lt;/span&gt;,
                 &lt;span style="color: #006080"&gt;"0.6"&lt;/span&gt;);
            }
            &lt;span style="color: #008000"&gt;//Close the URL node&lt;/span&gt;
            xmlTextWriter.WriteEndElement();
        }
        &lt;span style="color: #008000"&gt;//Now loop through all the &lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (PageData child &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;.DataFactory.Instance.GetChildren(p.PageLink))
        {

            RenderNodesToSiteMap(
                context,
                xmlTextWriter,
                alreadyAddedUrls,
                child);

        }
    }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;With all that done the last thing is to register it in the Web.config (inside the &lt;em&gt;System.Web&lt;/em&gt; element) as follows:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;httpHandlers&amp;gt;
  ...
  &amp;lt;add 
    path=&lt;span style="color: #006080"&gt;"sitemap.xml"&lt;/span&gt; 
    verb=&lt;span style="color: #006080"&gt;"*"&lt;/span&gt; 
    type=&lt;span style="color: #006080"&gt;"MyLibrary.SearchEngineSiteMap, MyLibrary"&lt;/span&gt; /&amp;gt;
  ...
&amp;lt;/httpHandlers&amp;gt;&lt;/pre&gt;
&lt;/div&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/312.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/06/12/EPiServer-Dynamic-SiteMap.xml-generator-for-Google.aspx</guid>
            <pubDate>Thu, 12 Jun 2008 10:09:22 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/312.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/06/12/EPiServer-Dynamic-SiteMap.xml-generator-for-Google.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/312.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer: Get a Page's Friendly URL</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/06/09/EPiServer-Get-a-Pages-Friendly-URL.aspx</link>
            <description>&lt;p&gt;As part of my Search Engine friendly SiteMap.xml generator (using a &lt;em&gt;HttpHandler -&lt;/em&gt; expect a blog post shortly...) I needed to output the friendly URL for each page in the site. However a call to PageData.LinkURL returns the actual link to the page (example shown below), not a "friendly" one that gets displayed in the browser address bar, or in any Hyperlink within the site.&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;/MySite/Default.aspx?id=26&amp;amp;epslanguage=en-GB&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I had a look through the EPiServer documentation and couldn't find anything obvious so resorted to creating my own method to do it (shown below). Simply pass the relevant &lt;em&gt;PageData&lt;/em&gt; object to the function and it will return the page's Friendly URL. e.g. &lt;em&gt;/mysite/en-GB/about-us&lt;/em&gt;&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Get a friendly URL for the given PageData object&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="pd"&amp;gt;The page to get the Friendly URL from&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;param name="Absolute"&amp;gt;Return an absolute path&amp;lt;/param&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;The friendly Url for the given PageData object&amp;lt;/returns&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetFriendlyUrl(PageData pd, &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; Absolute)
{
    UrlBuilder url = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; UrlBuilder(pd.LinkURL);
    &lt;span style="color: #008000"&gt;//Call UrlRewriteProvider's ConvertToExternal method&lt;/span&gt;
    EPiServer.Global.UrlRewriteProvider.ConvertToExternal(
       url,
       pd.PageLink,
       UTF8Encoding.UTF8);
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Absolute)
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; url.ToString();
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; StringUtilities.GetBaseUrl() + url.ToString();           
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you want to use Absolute paths you'll need to add this method:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Gets the base URL from the current Context.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetBaseUrl()
{
    &lt;span style="color: #008000"&gt;//First get the current port&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Port = HttpContext.Current.Request.ServerVariables[&lt;span style="color: #006080"&gt;"SERVER_PORT"&lt;/span&gt;];
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Port == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || Port == &lt;span style="color: #006080"&gt;"80"&lt;/span&gt; || Port == &lt;span style="color: #006080"&gt;"443"&lt;/span&gt;)
        Port = &lt;span style="color: #006080"&gt;""&lt;/span&gt;;
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #008000"&gt;//Its not a standard port so add it&lt;/span&gt;
        Port = &lt;span style="color: #006080"&gt;":"&lt;/span&gt; + Port;
    &lt;span style="color: #008000"&gt;//Now get the protocol (http or https)&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Protocol = HttpContext.Current.Request.ServerVariables[&lt;span style="color: #006080"&gt;"SERVER_PORT_SECURE"&lt;/span&gt;];
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Protocol == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || Protocol == &lt;span style="color: #006080"&gt;"0"&lt;/span&gt;)
        Protocol = &lt;span style="color: #006080"&gt;"http://"&lt;/span&gt;;
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
        Protocol = &lt;span style="color: #006080"&gt;"https://"&lt;/span&gt;;
    &lt;span style="color: #008000"&gt;//Finally combine the protocol, sever name and port&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url = Protocol + HttpContext.Current.Request.ServerVariables[&lt;span style="color: #006080"&gt;"SERVER_NAME"&lt;/span&gt;] + Port;
    &lt;span style="color: #008000"&gt;//EPiServer's url start with a / so remove the url if (when) it contains one&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (url.EndsWith(&lt;span style="color: #006080"&gt;"/"&lt;/span&gt;))
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; url.Remove(url.LastIndexOf(&lt;span style="color: #006080"&gt;"/"&lt;/span&gt;));
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; url;
}&lt;/pre&gt;
&lt;/div&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/310.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/06/09/EPiServer-Get-a-Pages-Friendly-URL.aspx</guid>
            <pubDate>Mon, 09 Jun 2008 11:33:10 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/310.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/06/09/EPiServer-Get-a-Pages-Friendly-URL.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/310.aspx</wfw:commentRss>
        </item>
        <item>
            <title>C#: Google Map Server Control - Part 2 - Custom EPiServer Property</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/06/09/C-Google-Map-Server-Control---Part-2---Custom.aspx</link>
            <description>&lt;p&gt;This post tells you how to take what I discussed in &lt;a title="Click here to read part one" href="http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx" target="_blank"&gt;Part 1&lt;/a&gt; and turn it into a custom EPiServer property, so CMS user's can simply enter a postcode and it will call of to Google's Local Search API, return the Coordinates for the postcode and plot a marker on the map. The user can then drag the marker for a more exact location, set the zoom level and finally the type of map (Normal, Satellite or Hybrid). The data is then rendered on the public site using the code from &lt;a title="Click here to read part one" href="http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx" target="_blank"&gt;Part 1&lt;/a&gt;. The screenshot below show's how it will look in EPiServer (click the thumbnail for the full size version):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.interakting.co.uk/images/blogs_interakting_co_uk/brad/WindowsLiveWriter/CGoogleMapServerControlPart2CustomEPiSer_ED99/GoogleMapEPiServer_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 0px 10px 0px 0px; border-left: 0px; border-bottom: 0px" height="243" alt="GoogleMapEPiServer" src="http://blogs.interakting.co.uk/images/blogs_interakting_co_uk/brad/WindowsLiveWriter/CGoogleMapServerControlPart2CustomEPiSer_ED99/GoogleMapEPiServer_thumb.jpg" width="222" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Creating a custom EPiServer property is relatively easy - although I think I've not quite got the hang of how to store the actual data. It must be converted to a string for storage in the database. I started to use an &lt;em&gt;XmlSerializer&lt;/em&gt; but got confused (mainly as the JavaScript was doing my head in) as to where i should be doing the serialisation. Sadly the only example i could find on the net was how to create a custom property that was a string - about as much use as a chocolate fire guard! So here's my way of doing it - using a comma separated string (dirty I know!) - please feel free to show me the correct way.&lt;/p&gt;  &lt;p&gt;EPiServer properties are split into two parts, the data and UI aspects. The first is how the data is persisted into the database, the second controls how the data is rendered to the page for both the public and on the edit page in the CMS.   &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1) &lt;em&gt;CoordinateProperty.cs&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;Firstly mark your class with the following attribute: &lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;[Serializable]
[PageDefinitionTypePlugIn(
    DisplayName = &lt;span style="color: #006080"&gt;"Coordinate"&lt;/span&gt;, 
    Description = &lt;span style="color: #006080"&gt;"Coordinate for use with (Google) Map Control"&lt;/span&gt;)]
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CoordinateProperty : PropertyData&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next some properties to help control the map:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; _string;

&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt;? Latitude
{
    get
    {
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(String) &amp;amp;&amp;amp; String.Contains(&lt;span style="color: #006080"&gt;','&lt;/span&gt;))
        {
            &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; temp = 0;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;.TryParse(String.Split(&lt;span style="color: #006080"&gt;','&lt;/span&gt;)[0].Trim(), &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; temp))
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; temp;
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
        }
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
     }
 }
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt;? Longitude
{
    get
    {
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(String) &amp;amp;&amp;amp; String.Contains(&lt;span style="color: #006080"&gt;','&lt;/span&gt;))
        {
            &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; temp = 0;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;.TryParse(String.Split(&lt;span style="color: #006080"&gt;','&lt;/span&gt;)[1].Trim(), &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; temp))
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; temp;
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
        }
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
    }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Zoom
{
    get
        {
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(String) &amp;amp;&amp;amp; String.Contains(&lt;span style="color: #006080"&gt;','&lt;/span&gt;))
        {
            &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; temp = 0;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;.TryParse(String.Split(&lt;span style="color: #006080"&gt;','&lt;/span&gt;)[2].Trim(), &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; temp))
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; temp;
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 5;
         }
         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 5;
    }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; MapType
{
    get
    {
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(String) &amp;amp;&amp;amp; String.Contains(&lt;span style="color: #006080"&gt;','&lt;/span&gt;))
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; String.Split(&lt;span style="color: #006080"&gt;','&lt;/span&gt;)[3].Trim();
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #006080"&gt;"Map"&lt;/span&gt;;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next the implementation for the abstract members of &lt;em&gt;PropertyData&lt;/em&gt;.&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; PropertyDataType Type
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; PropertyDataType.LongString; }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; Type PropertyValueType
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetType(); }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; Value
{
    get
    {
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.IsNull)
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.String;
    }
    set
    {
        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.ThrowIfReadOnly();
        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.SetPropertyValue(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt;
        {
            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.String = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.ToString();
        });
    }
}
[XmlIgnore]
&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; String
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._string; }
    set
    {
        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.ThrowIfReadOnly();
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (PropertyData.QualifyAsNullString(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;))
            &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Clear();
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._string != &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;) || (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.IsNull))
        {
            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._string = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
            &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Modified();
        }
    }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; PropertyData ParseToObject(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str)
{
    XmlSerializer SerializerObj = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlSerializer(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.GetType());
    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (TextReader stream = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringReader(str))
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (CoordinateProperty)SerializerObj.Deserialize(stream);
    }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ParseToSelf(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str)
{
    String = str;
}
&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetDefaultValue()
{
    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.String = &lt;span style="color: #006080"&gt;",,5,Map"&lt;/span&gt;;
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; IPropertyControl CreatePropertyControl()
{
    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CoordinatePropertyControl();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2) &lt;u&gt;&lt;em&gt;CoordinatePropertyControl.cs&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With that done we now need to control how the above class is rendered. First we need to add the four Textboxes:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;TextBox latitiude;
TextBox longitude;
TextBox zoom;
TextBox mapType;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next some basic methods, the first just makes it easier further down the line, the second is required:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Gets the CoordinateProperty instance for this IPropertyControl.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;value&amp;gt;The property that is to be displayed or edited.&amp;lt;/value&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; CoordinateProperty CoordinateProperty
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; PropertyData &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; CoordinateProperty; }
}
&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Does the property support in page edit&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; SupportsOnPageEdit
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next we need to provide code to display the Google Map in VIEW (public) mode, here we'll simply use the class we created in &lt;a title="Click here to read part one" href="http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx" target="_blank"&gt;Part 1&lt;/a&gt; of this post:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Inherited. Create a controls for rendering the property in view mode.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateDefaultControls()
{
    &lt;span style="color: #008000"&gt;//Check if the Latitude and Longitude have values&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.Latitude.HasValue &amp;amp;&amp;amp; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.Longitude.HasValue)
    {
        GoogleMap map = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GoogleMap();
        map.ID = &lt;span style="color: #006080"&gt;"map"&lt;/span&gt;;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Width.IsEmpty)
            map.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(100, UnitType.Percentage);
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            map.Width = Width;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Height.IsEmpty)
            map.Height = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(400, UnitType.Pixel);
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            map.Height = Height;

        map.Latitude = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.Latitude.Value;
        map.Longitude = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.Longitude.Value;
        map.Zoom = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.Zoom;
        map.MapType = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CoordinateProperty.MapType;
        Controls.Add(map);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Right that's the basics out of the way, now its time to control how the property is rendered in EDIT mode in the CMS, but first we need to add the JavaScript:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; JAVASCRIPT = &lt;span style="color: #006080"&gt;@"
&amp;lt;script src="&lt;/span&gt;&lt;span style="color: #006080"&gt;"http://maps.google.com/maps?file=api&amp;amp;amp;v=2&amp;amp;amp;key={0}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="&lt;/span&gt;&lt;span style="color: #006080"&gt;"http://www.google.com/uds/api?file=uds.js&amp;amp;amp;v=1.0&amp;amp;amp;key={1}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;
var map;
var localSearch = new GlocalSearch();

function usePointFromPostcode(postcode, callbackFunction) {{
    localSearch.setSearchCompleteCallback(null, 
        function() {{
            if (localSearch.results[0])
            {{        
                var resultLat = localSearch.results[0].lat;
                var resultLng = localSearch.results[0].lng;
                var point = new GLatLng(resultLat,resultLng);
                callbackFunction(point, 17);
            }}else{{
                alert("&lt;/span&gt;&lt;span style="color: #006080"&gt;"Postcode not found!"&lt;/span&gt;&lt;span style="color: #006080"&gt;");
            }}
        }});    
    localSearch.execute(postcode + "&lt;/span&gt;&lt;span style="color: #006080"&gt;", UK"&lt;/span&gt;&lt;span style="color: #006080"&gt;");
}}

function mapLoad() {{
    if (GBrowserIsCompatible()) {{
    //check map not already created!
        if(!map)
        {{
        map = new GMap2(document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{5}"&lt;/span&gt;&lt;span style="color: #006080"&gt;"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());

        var mType = document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{7}"&lt;/span&gt;&lt;span style="color: #006080"&gt;").value;
        if(mType == "&lt;/span&gt;&lt;span style="color: #006080"&gt;"Hybrid"&lt;/span&gt;&lt;span style="color: #006080"&gt;")
            map.setCenter(new GLatLng(54.622978,-2.592773), 5, G_HYBRID_MAP);
        else if(mType == "&lt;/span&gt;&lt;span style="color: #006080"&gt;"Satellite"&lt;/span&gt;&lt;span style="color: #006080"&gt;")
            map.setCenter(new GLatLng(54.622978,-2.592773), 5, G_SATELLITE_MAP);
        else
            map.setCenter(new GLatLng(54.622978,-2.592773), 5, G_NORMAL_MAP);

        GEvent.addListener(map, "&lt;/span&gt;&lt;span style="color: #006080"&gt;"zoomend"&lt;/span&gt;&lt;span style="color: #006080"&gt;", function(oldLevel, newLevel) {{
            //alert("&lt;/span&gt;&lt;span style="color: #006080"&gt;"Old Zoom: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + oldLevel + "&lt;/span&gt;&lt;span style="color: #006080"&gt;" New Level: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + newLevel);
            document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{6}"&lt;/span&gt;&lt;span style="color: #006080"&gt;").value = newLevel;
        }});

        GEvent.addListener(map, "&lt;/span&gt;&lt;span style="color: #006080"&gt;"maptypechanged"&lt;/span&gt;&lt;span style="color: #006080"&gt;", function() {{
            document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{7}"&lt;/span&gt;&lt;span style="color: #006080"&gt;").value = map.getCurrentMapType().getName();
            document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{6}"&lt;/span&gt;&lt;span style="color: #006080"&gt;").value = map.getZoom();
        }});
        
        }}
    }}
}}

function addLoadEvent(func) {{
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {{
    window.onload = func;
  }} else {{
    window.onload = function() {{
      oldonload();
      func();
    }}
  }}
}}

function addUnLoadEvent(func) {{
    var oldonunload = window.onunload;
    if (typeof window.onunload != 'function') {{
      window.onunload = func;
    }} else {{
      window.onunload = function() {{
        oldonunload();
        func();
      }}
    }}
}}

function placeMarkerAtPoint(point, zoom)
{{
    if(!map)
    {{
        mapLoad();
    }}
    var marker = new GMarker(point, {{draggable: true}});
    GEvent.addListener(marker, "&lt;/span&gt;&lt;span style="color: #006080"&gt;"dragstart"&lt;/span&gt;&lt;span style="color: #006080"&gt;", function() {{
        map.closeInfoWindow();
    }});
    GEvent.addListener(marker, "&lt;/span&gt;&lt;span style="color: #006080"&gt;"dragend"&lt;/span&gt;&lt;span style="color: #006080"&gt;", function() {{
        LoadCoordinates(marker.getPoint(), document.getElementById('{2}'), document.getElementById('{3}'));
        marker.openInfoWindowHtml("&lt;/span&gt;&lt;span style="color: #006080"&gt;"Lat: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + marker.getPoint().lat() + "&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;lt;br /&amp;gt;Lng: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + marker.getPoint().lng());
    }});
    map.clearOverlays();
    map.addOverlay(marker);
    setCenterToPoint(point, zoom);
    LoadCoordinates(point, document.getElementById('{2}'), document.getElementById('{3}'));
}}

function setCenterToPoint(point, zoom)
{{
    map.setCenter(point, parseInt(zoom));
}}

function showPointLatLng(point)
{{
    alert("&lt;/span&gt;&lt;span style="color: #006080"&gt;"Latitude: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + point.lat() + "&lt;/span&gt;&lt;span style="color: #006080"&gt;"\nLongitude: "&lt;/span&gt;&lt;span style="color: #006080"&gt;" + point.lng());
}}
function LoadCoordinates(point, txtLat, txtLng)
{{
    txtLat.value = point.lat();
    txtLng.value = point.lng();
}}

addLoadEvent(mapLoad);
addUnLoadEvent(GUnload);
&amp;lt;/script&amp;gt;"&lt;/span&gt;;

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; EXISTING = &lt;span style="color: #006080"&gt;@"
&amp;lt;script type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;
    placeMarkerAtPoint(new GLatLng({0},{1}),{2});
&amp;lt;/script&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Create the controls needed to edit the property&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateEditControls()
{
    &lt;span style="color: #008000"&gt;//Create controls required to edit the property&lt;/span&gt;
    latitiude = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBox();
    longitude = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBox();
    zoom = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBox();
    mapType = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBox();
    Label lLat = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Label();
    Label lLong = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Label();
    Label lZoom = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Label();
    Label lMapType = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Label();
    Literal brk1 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Literal();
    Literal brk2 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Literal();
    Literal brk3 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Literal();
    Literal brk4 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Literal();
    Label lPost = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Label();
    TextBox txtPostCode = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBox();
    Button btn = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Button();
    Panel Div = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Panel();

    &lt;span style="color: #008000"&gt;//Set the line break text.&lt;/span&gt;
    brk1.Text = &lt;span style="color: #006080"&gt;"&amp;lt;br /&amp;gt;"&lt;/span&gt;;
    brk2.Text = &lt;span style="color: #006080"&gt;"&amp;lt;br /&amp;gt;"&lt;/span&gt;;
    brk3.Text = &lt;span style="color: #006080"&gt;"&amp;lt;br /&amp;gt;"&lt;/span&gt;;
    brk4.Text = &lt;span style="color: #006080"&gt;"&amp;lt;br /&amp;gt;"&lt;/span&gt;;

    &lt;span style="color: #008000"&gt;//Set the Latitude TextBox properties&lt;/span&gt;
    latitiude.ID = &lt;span style="color: #006080"&gt;"latitiude"&lt;/span&gt;;
    latitiude.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginLeft, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    latitiude.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(140, UnitType.Pixel);

    &lt;span style="color: #008000"&gt;//Set the Longitude TextBox properties&lt;/span&gt;
    longitude.ID = &lt;span style="color: #006080"&gt;"longitude"&lt;/span&gt;;
    longitude.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginLeft, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    longitude.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(140, UnitType.Pixel);

    &lt;span style="color: #008000"&gt;//Set the Postcode TextBox properties&lt;/span&gt;
    txtPostCode.ID = &lt;span style="color: #006080"&gt;"postcode"&lt;/span&gt;;
    txtPostCode.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(140, UnitType.Pixel);
    txtPostCode.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginLeft, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    txtPostCode.Style.Add(&lt;span style="color: #006080"&gt;"text-transform"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"uppercase"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Set the MapType TextBox properties&lt;/span&gt;
    mapType.ID = &lt;span style="color: #006080"&gt;"maptype"&lt;/span&gt;;
    mapType.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginLeft, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    mapType.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(65, UnitType.Pixel);

    &lt;span style="color: #008000"&gt;//Set the Zoom TextBox properties&lt;/span&gt;
    zoom.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginLeft, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    zoom.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(65, UnitType.Pixel);

    &lt;span style="color: #008000"&gt;//Set the latitude label properties&lt;/span&gt;
    lLat.Text = &lt;span style="color: #006080"&gt;"Latitude"&lt;/span&gt;;
    lLat.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(60, UnitType.Pixel);
    lLat.Style.Add(&lt;span style="color: #006080"&gt;"float"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"left"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Set the longitude label properties&lt;/span&gt;
    lLong.Text = &lt;span style="color: #006080"&gt;"Longitude"&lt;/span&gt;;
    lLong.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(60, UnitType.Pixel);
    lLong.Style.Add(&lt;span style="color: #006080"&gt;"float"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"left"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Set the map type label properties&lt;/span&gt;
    lMapType.Text = &lt;span style="color: #006080"&gt;"Map Type"&lt;/span&gt;;
    lMapType.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(60, UnitType.Pixel);
    lMapType.Style.Add(&lt;span style="color: #006080"&gt;"float"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"left"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Set the postcode label properties&lt;/span&gt;
    lPost.Text = &lt;span style="color: #006080"&gt;"Post Code"&lt;/span&gt;;
    lPost.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(60, UnitType.Pixel);
    lPost.Style.Add(&lt;span style="color: #006080"&gt;"float"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"left"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Set the zoom label properties&lt;/span&gt;
    lZoom.Text = &lt;span style="color: #006080"&gt;"Zoom"&lt;/span&gt;;
    lZoom.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(60, UnitType.Pixel);
    lZoom.Style.Add(&lt;span style="color: #006080"&gt;"float"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"left"&lt;/span&gt;);
                    
    &lt;span style="color: #008000"&gt;//Set the button properties&lt;/span&gt;
    btn.Text = &lt;span style="color: #006080"&gt;"Look Up"&lt;/span&gt;;
    
    &lt;span style="color: #008000"&gt;//Set the map canvas&lt;/span&gt;
    Div.ID = &lt;span style="color: #006080"&gt;"mapDiv"&lt;/span&gt;;
    Div.Style.Add(System.Web.UI.HtmlTextWriterStyle.MarginTop, &lt;span style="color: #006080"&gt;"20px"&lt;/span&gt;);
    Div.Width = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(400, UnitType.Pixel);
    Div.Height = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Unit(400, UnitType.Pixel);

    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ApplyControlAttributes(latitiude);
    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ApplyControlAttributes(longitude);
    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ApplyControlAttributes(zoom);

    &lt;span style="color: #008000"&gt;//Add the controls to the controls collection&lt;/span&gt;
    Controls.Add(lPost);
    Controls.Add(txtPostCode);
    Controls.Add(btn);
    Controls.Add(brk1);
    Controls.Add(lLat);
    Controls.Add(latitiude);
    Controls.Add(brk2);
    Controls.Add(lLong);
    Controls.Add(longitude);
    Controls.Add(brk3);
    Controls.Add(lZoom);
    Controls.Add(zoom);
    Controls.Add(brk4);
    Controls.Add(lMapType);
    Controls.Add(mapType);
    Controls.Add(Div);

    &lt;span style="color: #008000"&gt;//Add the JavaScript required to render the google map&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsClientScriptIncludeRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(CoordinatePropertyControl), &lt;span style="color: #006080"&gt;"MAP"&lt;/span&gt;))
        Page.ClientScript.RegisterClientScriptBlock(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(CoordinatePropertyControl), &lt;span style="color: #006080"&gt;"MAP"&lt;/span&gt;, 
            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(JAVASCRIPT,
            WebConfigurationManager.AppSettings[&lt;span style="color: #006080"&gt;"GoogleMapKey"&lt;/span&gt;], &lt;span style="color: #008000"&gt;//0&lt;/span&gt;
            WebConfigurationManager.AppSettings[&lt;span style="color: #006080"&gt;"GoogleMapKey"&lt;/span&gt;], &lt;span style="color: #008000"&gt;//1&lt;/span&gt;
            latitiude.ClientID, &lt;span style="color: #008000"&gt;//2&lt;/span&gt;
            longitude.ClientID, &lt;span style="color: #008000"&gt;//3&lt;/span&gt;
            &lt;span style="color: #006080"&gt;""&lt;/span&gt;, &lt;span style="color: #008000"&gt;//4&lt;/span&gt;
            Div.ClientID, &lt;span style="color: #008000"&gt;//5&lt;/span&gt;
            zoom.ClientID, &lt;span style="color: #008000"&gt;//6&lt;/span&gt;
            mapType.ClientID, &lt;span style="color: #008000"&gt;//7&lt;/span&gt;
            PropertyData.Name &lt;span style="color: #008000"&gt;//8&lt;/span&gt;
            ));

    &lt;span style="color: #008000"&gt;//Add the onclick javascript to the postcode&lt;/span&gt;
    &lt;span style="color: #008000"&gt;//lookup button&lt;/span&gt;
    btn.Attributes.Add(&lt;span style="color: #006080"&gt;"onclick"&lt;/span&gt;, 
        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"usePointFromPostcode(document.getElementById('{0}').value, placeMarkerAtPoint); return false;"&lt;/span&gt;,
        txtPostCode.ClientID));

    &lt;span style="color: #008000"&gt;//Make the map type and zoom textboxes&lt;/span&gt;
    &lt;span style="color: #008000"&gt;//readonly as they are set by the google&lt;/span&gt;
    &lt;span style="color: #008000"&gt;//map control.&lt;/span&gt;
    zoom.Attributes.Add(&lt;span style="color: #006080"&gt;"readonly"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"true"&lt;/span&gt;);
    mapType.Attributes.Add(&lt;span style="color: #006080"&gt;"readonly"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"true"&lt;/span&gt;);

    &lt;span style="color: #008000"&gt;//Lastly populate the edit controls with values from the underlying CoordinateProperty&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.SetupEditControls();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;With that done we need to override the method which will populate the edit controls with values from the underlying CoordinateProperty (either default of from the database)&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Inherited. Initialize the value of the TextBox control.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetupEditControls()
{
    &lt;span style="color: #008000"&gt;//Set the zoom and map type textbox values&lt;/span&gt;
    zoom.Text = CoordinateProperty.Zoom.ToString();
    mapType.Text = CoordinateProperty.MapType;

    &lt;span style="color: #008000"&gt;//If the Latitude/Longitude have values set the relevant&lt;/span&gt;
    &lt;span style="color: #008000"&gt;//textbox properties and add the GoogleMap Javascript&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (CoordinateProperty.Latitude.HasValue &amp;amp;&amp;amp; CoordinateProperty.Longitude.HasValue)
    {
        latitiude.Text = CoordinateProperty.Latitude.Value.ToString();
        longitude.Text = CoordinateProperty.Longitude.Value.ToString();

        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsStartupScriptRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(CoordinatePropertyControl), 
            &lt;span style="color: #006080"&gt;"EXISTING"&lt;/span&gt;))
        {
            Page.ClientScript.RegisterStartupScript(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(CoordinatePropertyControl), 
                &lt;span style="color: #006080"&gt;"EXISTING"&lt;/span&gt;,
                &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(EXISTING,
                    latitiude.Text,
                    longitude.Text,
                    zoom.Text));
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Finally we must override the method which sets the value of the underlying CoordinateProperty with values entered in the UI by the user:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Inherited. Applies changes for the posted data to the page's properties when the RenderType property&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// is set to Edit.&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ApplyEditChanges()
{
    &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.SetValue(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(CultureInfo.InvariantCulture, &lt;span style="color: #006080"&gt;"{0},{1},{2},{3}"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.latitiude.Text, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.longitude.Text, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.zoom.Text, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.mapType.Text));
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And that's it - put it all together and you'll be able to configure a Google Map 'widget' in EPiServer.&lt;/p&gt;

&lt;p&gt;Oh - one small thing to note - the above JavaScript will only allow for ONE &lt;em&gt;CoordinateProperty&lt;/em&gt; to be added to a &lt;em&gt;PageType&lt;/em&gt;. If you add more than one to the same &lt;em&gt;PageType&lt;/em&gt; it will break. If I get time I'll change it, but our current requirement is only for one map per page - sorry!&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/309.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/06/09/C-Google-Map-Server-Control---Part-2---Custom.aspx</guid>
            <pubDate>Mon, 09 Jun 2008 09:24:21 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/309.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/06/09/C-Google-Map-Server-Control---Part-2---Custom.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/309.aspx</wfw:commentRss>
        </item>
        <item>
            <title>C#: Google Map Server Control - Part 1</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx</link>
            <description>&lt;p&gt;Following on from my Google Analytics server control, I wanted make something "cooler", so creating a Server Control to render a Google Map control seemed ideal. Part 1 covers the creation of the this control, stay tuned for &lt;a title="Read part two here" href="http://blogs.interakting.co.uk/brad/archive/2008/06/09/C-Google-Map-Server-Control---Part-2---Custom.aspx" target="_blank"&gt;part 2&lt;/a&gt; which will focus on creating a custom EPiServer property so it can be used in the EPiServer edit area, featuring Geocoding to lookup the coordinates from a UK post code, Map type selection and zoom level. &lt;/p&gt;  &lt;p&gt;Anyway here's the generic bit that can be used on any site...&lt;/p&gt;  &lt;p&gt;First off we need a set of basic properties to hold Latitude, Longitude, Zoom Level and Map Type:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 238px; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; Latitude
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetPropertyValue(&lt;span style="color: #006080"&gt;"Latitude"&lt;/span&gt;, (&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;)0); }
    set { SetPropertyValue(&lt;span style="color: #006080"&gt;"Latitude"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;); }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; Longitude
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetPropertyValue(&lt;span style="color: #006080"&gt;"Longitude"&lt;/span&gt;, (&lt;span style="color: #0000ff"&gt;double&lt;/span&gt;)0); }
    set { SetPropertyValue(&lt;span style="color: #006080"&gt;"Longitude"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;); }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Zoom
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetPropertyValue(&lt;span style="color: #006080"&gt;"Zoom"&lt;/span&gt;, 5); }
    set { SetPropertyValue(&lt;span style="color: #006080"&gt;"Zoom"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;); }
}
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; MapType
{
    get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; GetPropertyValue(&lt;span style="color: #006080"&gt;"MapType"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"Map"&lt;/span&gt;); }
    set { SetPropertyValue(&lt;span style="color: #006080"&gt;"MapType"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;); }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next come's the rather complex looking JavaScript code. I've done it so that it will allow multiple controls to be placed on the same page. IMPORTANT: Make sure you {0} in &lt;em&gt;COMMONJAVASCRIPT &lt;/em&gt;is your unique Google Maps/API Key, which is generated on a per domain basis.&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; COMMONJAVASCRIPT = &lt;span style="color: #006080"&gt;@"
        &amp;lt;script src="&lt;/span&gt;&lt;span style="color: #006080"&gt;"http://maps.google.com/maps?file=api&amp;amp;amp;v=2&amp;amp;amp;key={0}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;&amp;lt;/script&amp;gt;
        &amp;lt;script src="&lt;/span&gt;&lt;span style="color: #006080"&gt;"http://www.google.com/uds/api?file=uds.js&amp;amp;amp;v=1.0&amp;amp;amp;key={0}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;&amp;lt;/script&amp;gt;"&lt;/span&gt;;
        
        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; JAVASCRIPT = &lt;span style="color: #006080"&gt;@"
        &amp;lt;script type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;
        function GoogleMapLoad{6}() {{
          if (GBrowserIsCompatible()) {{
            var map = new GMap2(document.getElementById("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{3}"&lt;/span&gt;&lt;span style="color: #006080"&gt;"));
        
                if("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{5}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" == "&lt;/span&gt;&lt;span style="color: #006080"&gt;"Hybrid"&lt;/span&gt;&lt;span style="color: #006080"&gt;")
                   map.setCenter(new GLatLng({1},{2}), parseInt({4}), G_HYBRID_MAP);
                else if("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{5}"&lt;/span&gt;&lt;span style="color: #006080"&gt;" == "&lt;/span&gt;&lt;span style="color: #006080"&gt;"Satellite"&lt;/span&gt;&lt;span style="color: #006080"&gt;")
                   map.setCenter(new GLatLng({1},{2}), parseInt({4}), G_SATELLITE_MAP);
                else
                   map.setCenter(new GLatLng({1},{2}), parseInt({4}), G_NORMAL_MAP);
                
                var point = new GLatLng({1},{2});
                map.addOverlay(new GMarker(point));
                map.addControl(new GMapTypeControl());
                map.addControl(new GLargeMapControl());
            }}
        }}
        &amp;lt;/script&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Next we need to override the default tag that the server control would typically render (span) with a div, so that the Google map has a "canvas".&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;//Google map must be rendered inside a &amp;lt;DIV&amp;gt; tag, so we'll override the default &amp;lt;SPAN&amp;gt;.&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; HtmlTextWriterTag TagKey
{
    get
    {
        &lt;span style="color: #008000"&gt;//Return DIV not SPAN&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; HtmlTextWriterTag.Div;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And last but not least, the overloaded &lt;em&gt;CreateChildControls()&lt;/em&gt;. Firstly we check to see if there are (valid) Latitude and longitude values, if there is we register two blocks of JavaScript. Notice the second block's key includes the controls ID - which allows multiple maps to be used on the same page. The first 'common' block will only be registered once regardless of how many maps on the page. The second block has five strings passed to it which include the Google API Key (stored in the AppSettings) the control's ClientID (so the map's canvas can be accessed) along with the lat/lng/zoom etc.&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateChildControls()
{
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Latitude != 0 &amp;amp;&amp;amp; Longitude != 0)
    {
        &lt;span style="color: #008000"&gt;//Check if the COMMON google map javascript block has been registered&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsClientScriptBlockRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMap"&lt;/span&gt;))
            Page.ClientScript.RegisterClientScriptBlock(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMap"&lt;/span&gt;, COMMONJAVASCRIPT);

        &lt;span style="color: #008000"&gt;//Check if the google map javascript block for THIS map has been registered&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsClientScriptBlockRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMap"&lt;/span&gt; + ID))
            Page.ClientScript.RegisterClientScriptBlock(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMap"&lt;/span&gt; + ID, 
                &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(CultureInfo.InvariantCulture, JAVASCRIPT,
                        WebConfigurationManager.AppSettings[&lt;span style="color: #006080"&gt;"GoogleMapKey"&lt;/span&gt;], &lt;span style="color: #008000"&gt;//0&lt;/span&gt;
                        Latitude,  &lt;span style="color: #008000"&gt;//1&lt;/span&gt;
                        Longitude, &lt;span style="color: #008000"&gt;//2&lt;/span&gt;
                        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ClientID, &lt;span style="color: #008000"&gt;//3&lt;/span&gt;
                        Zoom, &lt;span style="color: #008000"&gt;// 4&lt;/span&gt;
                        MapType, &lt;span style="color: #008000"&gt;//5&lt;/span&gt;
                        ClientID &lt;span style="color: #008000"&gt;//6), &lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);

        &lt;span style="color: #008000"&gt;//Now we need to add the google maps onload JavaScript function for THIS MAP ONLY (it its not be added already)&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsStartupScriptRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMapLoad"&lt;/span&gt; + ID))
            Page.ClientScript.RegisterStartupScript(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMapLoad"&lt;/span&gt; + ID, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"GoogleMapLoad{0}();"&lt;/span&gt;, ClientID), &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);

        &lt;span style="color: #008000"&gt;//Now we need to add the google maps onUNload JavaScript function (it its not be added already)&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!Page.ClientScript.IsStartupScriptRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMapUnload"&lt;/span&gt;))
            Page.ClientScript.RegisterStartupScript(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleMap), &lt;span style="color: #006080"&gt;"GoogleMapUnload"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"window.onunload = function () { GUnload(); };"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);
    }
    &lt;span style="color: #008000"&gt;//now call the base controls Create Child Controls&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.CreateChildControls();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;UPDATED:&lt;/strong&gt; Check out &lt;a href="http://blogs.interakting.co.uk/brad/archive/2008/06/09/C-Google-Map-Server-Control---Part-2---Custom.aspx" target="_blank"&gt;part 2&lt;/a&gt; for how to use this with EPiServer.&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/308.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx</guid>
            <pubDate>Fri, 06 Jun 2008 15:17:03 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/308.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/06/06/C-Google-Map-Server-Control---Part-1.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/308.aspx</wfw:commentRss>
        </item>
        <item>
            <title>C#: Google Analytics Server Control</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/06/04/C-Google-Analytics-Server-Control.aspx</link>
            <description>&lt;p&gt;Today I've been consolidating UserControls that I've found myself using in one &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt; project after another into a nice Server Control library. One such control that gets used on every site (even non-EPiServer ones) is one which adds the &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; &lt;a title="Google Analytics" href="http://www.google.com/analytics" target="_blank"&gt;Analytics&lt;/a&gt; JavaScript code to the page. I decided this would be the first UserControl to migrate.&lt;/p&gt;  &lt;p&gt;Firstly I created a constant &lt;em&gt;GoogleAnalyticsJavaScript&lt;/em&gt; which holds the JavaScript string to be added to the page. The only change I needed to make was to dynamically add the unique &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; &lt;a title="Google Analytics" href="http://www.google.com/analytics" target="_blank"&gt;Analytics&lt;/a&gt; tracking code that was generated specifically for my domain. I could have stored this as a dynamic property in &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;, but decided that since it would hardly change, if ever, that the AppSettings would be a more suitable place. (This also makes the code more portable - sorry &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt;!) &lt;/p&gt;  &lt;p&gt;So I simply overrided the &lt;em&gt;CreateChildControls&lt;/em&gt; and perform a quick check to make sure that there is a AppSetting with a Key of &lt;em&gt;GoogleAnalyticsKey&lt;/em&gt; and that the script hasn't already been added to the page. Next i had to register it as a startup script (I chose startup script so it would be rendered near the end of body tag - perfect for situations where I want to add specific custom &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; tracking to links within my page - I.e. downloads, RSS feeds etc. Registering a standard script block would appear at the top of the body meaning that custom link tracking wouldn't work).&lt;/p&gt;  &lt;p&gt;The code listing is shown below:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 426px; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; height: 582px; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; GoogleAnalytics : InteraktingServerControl
{
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GoogleAnalyticsJavaScript = &lt;span style="color: #006080"&gt;@"
        &amp;lt;script type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;
        /* &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; TRACKING CODE */
        var gaJsHost = (("&lt;/span&gt;&lt;span style="color: #006080"&gt;"https:"&lt;/span&gt;&lt;span style="color: #006080"&gt;" == document.location.protocol) ? "&lt;/span&gt;&lt;span style="color: #006080"&gt;"https://ssl."&lt;/span&gt;&lt;span style="color: #006080"&gt;" : "&lt;/span&gt;&lt;span style="color: #006080"&gt;"http://www."&lt;/span&gt;&lt;span style="color: #006080"&gt;");
        document.write(unescape("&lt;/span&gt;&lt;span style="color: #006080"&gt;"%3Cscript src='"&lt;/span&gt;&lt;span style="color: #006080"&gt;" + gaJsHost + "&lt;/span&gt;&lt;span style="color: #006080"&gt;"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"&lt;/span&gt;&lt;span style="color: #006080"&gt;"));
        &amp;lt;/script&amp;gt;
        &amp;lt;script type="&lt;/span&gt;&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: #006080"&gt;"&amp;gt;
        var pageTracker = _gat._getTracker("&lt;/span&gt;&lt;span style="color: #006080"&gt;"{0}"&lt;/span&gt;&lt;span style="color: #006080"&gt;");
        pageTracker._initData();
        pageTracker._trackPageview();
        /* &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; TRACKING CODE */
        &amp;lt;/script&amp;gt;"&lt;/span&gt;;

    &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateChildControls()
    {
        &lt;span style="color: #008000"&gt;//Make sure the &lt;a title="Google" href="http://www.google.co.uk" target="_blank"&gt;Google&lt;/a&gt; &lt;a title="Google Analytics" href="http://www.google.com/analytics" target="_blank"&gt;Analytics&lt;/a&gt; key is set in the AppSettings&lt;/span&gt;
        &lt;span style="color: #008000"&gt;//Also make sure the script hasn't been registered already&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(WebConfigurationManager.AppSettings[&lt;span style="color: #006080"&gt;"GoogleAnalyticsKey"&lt;/span&gt;])
             &amp;amp;&amp;amp; Page.ClientScript.IsStartupScriptRegistered(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleAnalytics), &lt;span style="color: #006080"&gt;"GoogleAnalyticsKey"&lt;/span&gt; + ID))
        {
            Page.ClientScript.RegisterStartupScript(
                &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(GoogleAnalytics),
                &lt;span style="color: #006080"&gt;"GoogleAnalyticsKey"&lt;/span&gt; + ID,
                &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(
                    GoogleAnalyticsJavaScript, 
                    WebConfigurationManager.AppSettings[&lt;span style="color: #006080"&gt;"GoogleAnalyticsKey"&lt;/span&gt;]
                    )
                );
         }
        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.CreateChildControls();
    }
}&lt;/pre&gt;
&lt;/div&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/305.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/06/04/C-Google-Analytics-Server-Control.aspx</guid>
            <pubDate>Wed, 04 Jun 2008 11:20:35 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/305.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/06/04/C-Google-Analytics-Server-Control.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/305.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer Language Selector</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/05/28/EPiServer-Language-Selector.aspx</link>
            <description>&lt;p&gt;Today I needed to create a UserControl to allow a user to select to view the current page from a list of enabled languages. To begin with I thought it would be a fairly easy task, by simply calling &lt;em&gt;GetLanguageBranches()&lt;/em&gt; in the &lt;em&gt;DataFactory&lt;/em&gt; class. However this ONLY returns the versions of the page that have been translated, which didn't suit me as our requirement was that ALL (enabled) languages should be displayed in the language selector, and if a language version doesn't exist for the specific page then the fallback language be used. &lt;/p&gt;  &lt;p&gt;So next I tried looping through the results from &lt;em&gt;EPiServer.DataAbstraction.LanguageBranch.ListEnabled();&lt;/em&gt; This seemed to be just what I needed, so I set about looping through all the languages, displaying a hyperlink for each, with the &lt;em&gt;Text&lt;/em&gt; being the name of the language. The &lt;em&gt;NavigateUrl&lt;/em&gt; property was much trickier - why is nothing ever simple! &lt;/p&gt;  &lt;p&gt;So next I set about trying to return a language specific version of a page for each of my enabled languages, at first I tried using:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; height: 38px; background-color: #f4f4f4; border-bottom-style: none"&gt;EPiServer.DataFactory.Instance.GetPage(
&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; LanguageSelector( [Language code here] )).LinkURL &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This caused two problems, firstly this only works if the page exists in that language, with a &lt;em&gt;LanguageNotFound&lt;/em&gt; exception thrown otherwise. So in the &lt;em&gt;Catch&lt;/em&gt; block I tried:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; height: 38px; background-color: #f4f4f4; border-bottom-style: none"&gt;EPiServer.DataFactory.Instance.GetPage(
LanguageSelector.FallBack( [Language code here] )).LinkURL &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Much to my annoyance however, it always rendered to the currently selected language. My first thought was EPiServer's &lt;em&gt;TemplatePage&lt;/em&gt; or a &lt;em&gt;ControlAdapter &lt;/em&gt;were causing this when they generate the "FriendlyUrl", however while debugging I realised that the &lt;em&gt;LinkUrl&lt;/em&gt;  property of the &lt;em&gt;PageData&lt;/em&gt; class had the incorrect language code as part of the query string. So it must use the current culture when generating the URL string, regardless of the actual page.&lt;/p&gt;

&lt;p&gt;Enter &lt;a title="Click to see Steve's Blog" href="http://blogs.interakting.co.uk/steve" target="_blank"&gt;Steve&lt;/a&gt;, who suggested I try setting the culture to that of the SPECIFIC language before getting a reference to the page and getting it's &lt;em&gt;LinkUrl &lt;/em&gt;property, and bingo it worked! The only thing to remember is to make sure I set the culture back to the correct one at the end of the loop to make sure I didn't break anything further down the response.&lt;/p&gt;

&lt;p&gt;Here's the code. I've not included the code listing for the &lt;em&gt;LanguageItem&lt;/em&gt; class to keep the post short, but you should get the gist of what's going on...&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!IsPostBack)
{
    &lt;span style="color: #008000"&gt;//Create a list to hold LanguageItem's (which simply has 'Name'/'Url'/'ImageUrl' properties)&lt;/span&gt;
    List&amp;lt;LanguageItem&amp;gt; langs = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;LanguageItem&amp;gt;();
    &lt;span style="color: #008000"&gt;//Get the current culture as we'll need it later&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; currentCulture = EPiServer.Globalization.GlobalizationSettings.CultureLanguageCode;
    &lt;span style="color: #008000"&gt;//Loop through every enabled language&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (LanguageBranch lang &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; EPiServer.DataAbstraction.LanguageBranch.ListEnabled())
    {
        &lt;span style="color: #008000"&gt;//Set the culture to the language of the link being constructed.&lt;/span&gt;
        EPiServer.Globalization.ContentLanguage.Instance.SetCulture(lang.LanguageID); 
        langs.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; LanguageItem(
        &lt;span style="color: #008000"&gt;//The name of the language&lt;/span&gt;
        lang.Name,
        &lt;span style="color: #008000"&gt;//Get the current page (but as we've set a new culture it will get the &lt;/span&gt;
        &lt;span style="color: #008000"&gt;//relevant lanaguage if it exists, or the fallback if doesn't.&lt;/span&gt;
        EPiServer.DataFactory.Instance.GetPage(CurrentPage.PageLink).LinkURL,
        &lt;span style="color: #008000"&gt;//Finally generate the url to the Language's Image (e.g. a flag)&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"~/App_Themes/{0}/Images/Languages/{1}.gif"&lt;/span&gt;, Page.Theme,  lang.LanguageID)));
    }
    &lt;span style="color: #008000"&gt;//Finally set the culture back to the what it was at the beginning.&lt;/span&gt;
    EPiServer.Globalization.ContentLanguage.Instance.SetCulture(currentCulture); 
    &lt;span style="color: #008000"&gt;//Set the LanguageItem list as the DataSource for the repeater and bind&lt;/span&gt;
    rLanguages.DataSource = langs;
    rLanguages.DataBind();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If anyone happens to know of a 'better' way of doing this please let me know... i spent ages trying to get it to work, and sadly EPiServer's documentation was non-existent. I also couldn't find any blogs/articles on how to do it, which is why i decided to share it with you all...&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/302.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/05/28/EPiServer-Language-Selector.aspx</guid>
            <pubDate>Wed, 28 May 2008 12:55:54 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/302.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/05/28/EPiServer-Language-Selector.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/302.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer 4.6x: Pages/Images/CSS not displaying on new site install</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/01/18/178.aspx</link>
            <description>&lt;p&gt;I've just come back to do a "Phase II" of an old &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt; 4.61 project and was having issue's with none of the child pages working, or even the CSS being loaded in the CMS area. I decided to investigate the style sheet error in the admin area - it was looking for /util/styles/system.css but if I looked in the file system such a file didn't exist... hmm! Then I realised it must be a virtual path and remembered that pre version 5 &lt;a title="EPiServer Content Management System" href="http://www.episerver.com" target="_blank"&gt;EPiServer&lt;/a&gt; used a custom error page to return virtual files and to do its friendly URL re-writing. So I looked in &lt;a title="Microsoft IIS" href="http://www.microsoft.com/windowsserver2003/iis/default.mspx" target="_blank"&gt;IIS&lt;/a&gt; and bingo there was the problem.... &lt;a title="Microsoft IIS" href="http://www.microsoft.com/windowsserver2003/iis/default.mspx" target="_blank"&gt;IIS&lt;/a&gt; was using the default 404 error page, once it was changed to /Util/Notfound.aspx everything sprung into life...&lt;/p&gt;  &lt;p&gt;Tip from &lt;a title="Steven Horsfield's Blog" href="http://blogs.bdnet.co.uk/steve" target="_blank"&gt;Steve&lt;/a&gt;: If you Open EPiManager and click on the offending site you'll get a warning message saying that &lt;a title="Microsoft IIS" href="http://www.microsoft.com/windowsserver2003/iis/default.mspx" target="_blank"&gt;IIS&lt;/a&gt;'s configuration is incorrect - do you want to fix the 404 error page value! If only I'd thought to look there earlier!!&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/178.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/01/18/178.aspx</guid>
            <pubDate>Fri, 18 Jan 2008 10:39:55 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/178.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/01/18/178.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/178.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer Licensing</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2008/01/17/177.aspx</link>
            <description>&lt;p&gt;I seem to spend my whole life re-licensing EPiServer sites during development, then again when it gets moved to stage and finally production. Each time I go to EPiServer's site and can never find a simple link to generate a licence and always end up having to go the download area, re-register my details blah blah blah.&lt;/p&gt;  &lt;p&gt;Anyway here's the link I should have been using - and it's now firmly bookmarked!!&lt;/p&gt;  &lt;p&gt;&lt;a title="http://license.ep.se/public/" href="http://license.ep.se/public/" target="_blank"&gt;http://license.ep.se/public/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/177.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2008/01/17/177.aspx</guid>
            <pubDate>Thu, 17 Jan 2008 14:39:01 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/177.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2008/01/17/177.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/177.aspx</wfw:commentRss>
        </item>
        <item>
            <title>EPiServer Subscription</title>
            <link>http://blogs.interakting.co.uk/brad/archive/2007/12/14/127.aspx</link>
            <description>I've been using EPiServer's built-in subscription functionality on a few 4.61 projects with no problems... when i tried it on my first version 5 one i had a few issues - namely the subject and read more links were in Swedish and i couldn't set the mail from address... Here's how i fixed them:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;Swedish Text - Default language was set to Swedish (based on the demo content added at install time i think) - thanks EPiServer support for helping me with this.&lt;/li&gt;
    &lt;li&gt;"From" Email Address (and the "Read More", email "body text" etc) In 4.61 these were set on the Subscription page type, in version 5 this is done on the page that is marked for subscription (has EPSUBSCRIBE property) - you add the following properties (should be fairly obvious what they're for):
    &lt;ul&gt;
        &lt;li&gt;MailFrom&lt;/li&gt;
        &lt;li&gt;MailSubject&lt;/li&gt;
        &lt;li&gt;MailBody&lt;/li&gt;
        &lt;li&gt;MailReadMore&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ol&gt;
The change in point two is great - as now you can set different email address/email bodies per subscription area!&lt;img src="http://blogs.interakting.co.uk/brad/aggbug/127.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Brad</dc:creator>
            <guid>http://blogs.interakting.co.uk/brad/archive/2007/12/14/127.aspx</guid>
            <pubDate>Fri, 14 Dec 2007 11:14:14 GMT</pubDate>
            <wfw:comment>http://blogs.interakting.co.uk/brad/comments/127.aspx</wfw:comment>
            <comments>http://blogs.interakting.co.uk/brad/archive/2007/12/14/127.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.interakting.co.uk/brad/comments/commentRss/127.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>