
A jQuery Plugin for adding IE9 features (site pinning, site mode, etc.) to your websites. Several new features of Internet Explorer 9 are designed to enhance the browsing experience of consumers by enabling sites that leverage certain features to behave like applications on the desktop when those sites are ‘pinned’ to the taskbar in Windows 7. A user pins a site by dragging the site’s tab (or favicon in the address bar) to the taskbar. For all sites, IE9 will create a default experience (called ‘site mode’) that will use information about the site to create an instance of the browser customized to look specific to that site. Developers can also add specific meta tags and script commands to extend these features to further customize user’s pinned experience of the site.
Your site, from zero-to-pinned in less than 5 minutes:
- install-package jquery.ie9ify
- $(‘head’).pinify();
- Run and Pin!
More information at http://ie9ify.codeplex.com/
When I am working on some project, it is normal to need to analyze the queries that are executed on the database to detect a possible bug or something that is not matched with what I expected.
For this, SQL Server Profiler gives me a good and quick overview of what is being requested for each connection to the database.
The case of a registration in the profiler can be shown as:

As can be seen in the Application Name column has the value ".Net Sql Client Data Provider", which makes it very difficult in filtering to only the application that we intend to analyze the data.
To avoid this, we only need to indicate on ConnectionString, the name of our application, and everything gets easier.
"Data Source=localhost;Initial Catalog=MyDatabase;
Integrated Security=True;Application Name=MyAppName"
After that, we get something more friendly like:

After HTML 5 Microsoft WebCamp Portugal, I came up with some interest in exploring the Menubar plugin.
This plugin transforms a list into a nice menu, and as such, I like to implement it on a project which I use web.sitemap.
To this, I needed to use an XSLT to transform the web.sitemap file, which is nothing more an XML, into an unordered list in a format required by Menubar.
Here’s an example of web.sitemap file:
<?xml version="1.0" encoding="utf-8"?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="~/" title="Home" description="Home">
<siteMapNode url="" title="Menu 1" description="Menu 1" >
<siteMapNode url="http://www.google.pt" title="Submenu 1" description="Submenu 1" />
</siteMapNode>
<siteMapNode url="" title="Menu 2" description="Menu 2">
<siteMapNode url="http://www.microsoft.com" title="Submenu 2" description="Submenu 2" />
<siteMapNode url="http://www.apple.com" title="Submenu 3" description="Submenu 3" />
</siteMapNode>
</siteMapNode>
</siteMap>
To transform the XML file on an unordered list, I’ve used the next XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:map="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"
exclude-result-prefixes="map">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="map:siteMapNode">
<li>
<a href="{@url}" title="{@description}">
<xsl:value-of select="@title"/>
</a>
<xsl:if test="map:siteMapNode">
<ul>
<xsl:call-template name="mapNode"/>
</ul>
</xsl:if>
</li>
</xsl:template>
<xsl:template name="mapNode" match="/*/*">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
This way, I’m getting an list like this:
<?xml version="1.0" encoding="utf-16" ?>
<li><a href="" title="Menu 1">Menu 1</a>
<ul>
<li><a href="http://www.google.pt" title="Submenu 1">Submenu 1</a></li>
</ul>
</li>
<li><a href="" title="Menu 2">Menu 2</a>
<ul>
<li><a href="http://www.microsoft.com" title="Submenu 2">Submenu 2</a></li>
<li><a href="http://www.apple.com" title="Submenu 3">Submenu 3</a></li>
</ul>
</li>
Finally, we only need to add a XML control to render the list:
<ul id="bar1" class="menubar">
<asp:Xml runat="server" ID="xmlSiteMapViewer" DocumentSource="~/web.sitemap" TransformSource="~/sitemap.xslt" />
</ul>
The insertion of XML control between an unordered list was deliberated, because only then we have the menu working properly and like the one on this site:
http://view.jqueryui.com/master/demos/menubar/default.html
Since we don’t have a direct way to indicate that some user will be locked, the only way I got to do that, was forcing a wrong login multiple times, until reach the maximum attempts defined on “maxInvalidPasswordAttemps” attribute.
When we use ASP.NET Membership, on web.config file you have something like this:
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MyAppConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" applicationName="MyAppName" />
And the code I use is:
public static bool LockUser(MembershipUser user)
{
try
{
for (int i = 0; i < Membership.MaxInvalidPasswordAttempts; i++)
Membership.ValidateUser(user.UserName, "thisisandummypasswordonlytolocktheuser");
return user.IsLockedOut;
}
catch (Exception)
{
throw;
}
}
Hope it helps.