Thursday, May 15, 2008
A while ago, I came across an interesting work around for getting the latitude and longitude from Google Maps. It can be quite difficult to get the lat&lon - usually you have to get the link to the page and from that get the lat&lon.

Now, there is an easier way. If you create a bookmark or a link on a bookmark toolbar pointing to:

javascript:void(prompt('',gApplication.getMap().getCenter()))

You get the current lat&lon in the popup box once you click on your bookmark ;)

5/15/2008 5:45:56 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, May 09, 2008
XHTML Strict validation - one of the things that Tsuko insisted during our work on SPT - helped me to discover an interesting behaviour of the ASP.NET with the W3.org validator.

ASP.NET 2 has a built in functionality that affects the way controls are rendered. This can be controlled by inserting a <xhtmlConformance mode="Strict|Transitional|Legacy" /> tag in the web.config - the default is Transitional. However, even though you choose the strict mode, W3.org validation fails. This is caused by the fact that the w3 validator is treated as a lesser browser.

So in order to get the validation working, you need to create a w3cvalidator.browser file in the ~/App_Browsers folder and add the following content to the file

<browsers>
<!--
Browser capability file for the w3c validator

sample UA: "W3C_Validator/1.305.2.148 libwww-perl/5.803"
-->
<browser id="w3cValidator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>

<capture>
<userAgent match="^W3C_Validator/(?'version'(?'major'\d+)(?'minor'\.\d+)\w*).*" />
</capture>

<capabilities>
<capability name="browser" value="w3cValidator" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="version" value="${version}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="xml" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
</capabilities>
</browser>
</browsers>

read the whole article at http://idunno.org/archive/2005/01/01/216.aspx

5/9/2008 5:17:02 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, May 01, 2008

When you add a WMS:Lister control to the actual article template (e.g. a "News Detail" template) the lister may break.  This is because the "ItemIdentifier" attribute is repeated twice on the page!

For example: Say you have an article page that uses <!-- item --> to identify the region of the page the PatternFile refers to, if you then add an actual lister control to the page you end up with two <!-- item --> comments (see below). Once in teh new lister and once for the article!

  <ez:Lister ID="scrollingNews" runat="server" PageSize="4" 
     SortBy="Date" SortDirection="Desc" PatternFile="~/NewsPattern.txt" ItemFileExtension="*.aspx"
     ItemDirectory="~/News" PagerStyle="None" ItemIdentifier="<!-- item -->"
     CreateCacheIndex="true" FilterKey="Section" FilterValue="">
     <HeaderTemplate><span id="news_listing"></HeaderTemplate>
     <ItemTemplate>
       <a href="<%# ((ListerItem)Container.DataItem).Link %>">
        <wg:PlainText MaxLength="80" Text='<%# ((ListerItem)Container.DataItem).GetValue("text") %>' runat="server" />...
       </a>
     </ItemTemplate>
    <FooterTemplate></span></FooterTemplate>
  </ez:Lister>

The fix is simply to leave the ItemIdentifier attribute out of any Lister control.  The default value is <!-- item -->, so you only need the attribute if you need a different value.

:)

code | WMS
5/1/2008 11:57:00 AM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback