<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tiago Salgado &#187; asp.net</title>
	<atom:link href="http://blog.tiagosalgado.com/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tiagosalgado.com</link>
	<description>personal blog</description>
	<lastBuildDate>Sat, 21 Jan 2012 15:20:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Ajax Control Toolkit &#8211; Setembro 2011</title>
		<link>http://blog.tiagosalgado.com/2011/09/29/ajax-control-toolkit-setembro-2011/</link>
		<comments>http://blog.tiagosalgado.com/2011/09/29/ajax-control-toolkit-setembro-2011/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 10:32:07 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ajax control toolkit]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/?p=1149</guid>
		<description><![CDATA[O Ajax Control Toolkit foi actualizado, e foram incluidas algumas novas funcionalidades como por exemplo o controlo para o Twitter, Gravatar, e a possibilidade de definir intervalos de datas no Calender Extender para limitar a escolha do utilizador. Podem ver no blog do Stephen Walther o anúncio desta nova versão, e exemplos de como utilizar]]></description>
			<content:encoded><![CDATA[<p>O <a href="http://ajaxcontroltoolkit.codeplex.com/" target="_blank">Ajax Control Toolkit</a> foi actualizado, e foram incluidas algumas novas funcionalidades como por exemplo o controlo para o <a href="http://twitter.com" target="_blank">Twitter</a>, <a href="http://gravatar.com" target="_blank">Gravatar</a>, e a possibilidade de definir intervalos de datas no Calender Extender para limitar a escolha do utilizador.</p>
<p>Podem ver no <a href="http://stephenwalther.com/blog/archive/2011/09/27/september-2011-release-of-the-ajax-control-toolkit.aspx" target="_blank">blog do Stephen Walther</a> o anúncio desta nova versão, e exemplos de como utilizar estas novas funcionalidades.</p>
<p><script src="https://gist.github.com/1250490.js"> </script><br />
<span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;"><img class="alignnone" title="twitter_gravatar_aspnet" src="http://img3.imageshack.us/img3/5315/twittergravataraspnet.png" alt="" width="324" height="624" /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/09/29/ajax-control-toolkit-setembro-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET Mobile Framework</title>
		<link>http://blog.tiagosalgado.com/2011/09/11/asp-net-mobile-framework/</link>
		<comments>http://blog.tiagosalgado.com/2011/09/11/asp-net-mobile-framework/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 15:46:29 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/?p=1085</guid>
		<description><![CDATA[Project Description ASP.NET Mobile Framework (AMF) is a framework for making web application for most-used tablet and smartphone web browsers.   Mais em http://amf.codeplex.com/]]></description>
			<content:encoded><![CDATA[<p><strong>Project Description</strong><br />
ASP.NET Mobile Framework (AMF) is a framework for making web application for most-used tablet and smartphone web browsers.</p>
<p><img src="http://www.ymartel.com/aspnet-mobile-framework/wp-content/uploads/2011/08/icons.jpg" alt="" width="192" height="288" /> <img src="http://www.ymartel.com/aspnet-mobile-framework/wp-content/uploads/2011/08/dialog2.jpg" alt="" width="192" height="288" /></p>
<p>Mais em <a href="http://amf.codeplex.com/">http://amf.codeplex.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/09/11/asp-net-mobile-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SpecExpress : A Fluent Validation Framework</title>
		<link>http://blog.tiagosalgado.com/2011/09/11/specexpress-a-fluent-validation-framework/</link>
		<comments>http://blog.tiagosalgado.com/2011/09/11/specexpress-a-fluent-validation-framework/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 14:44:49 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[codeplex]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/2011/09/11/specexpress-a-fluent-validation-framework/</guid>
		<description><![CDATA[Project Description SpecExpress is a fluent validation framework and container for .Net that makes it easier to write validation rules and validate your objects. SpecExpress also offers integration with ASP.NET WebForms, eliminating duplication of your validation rules. Features The SpecExpress DSL provides developers with a Fluent Interface for quickly composing rules that are also easy]]></description>
			<content:encoded><![CDATA[<p><strong>Project Description</strong><br />
SpecExpress is a fluent validation framework and container for .Net that makes it easier to write validation rules and validate your objects. SpecExpress also offers integration with ASP.NET WebForms, eliminating duplication of your validation rules.</p>
<h4>Features</h4>
<ul>
<li>The SpecExpress DSL provides developers with a Fluent Interface for quickly composing rules that are also easy to read. See a <a href="http://specexpress.codeplex.com/wikipage?title=Quick%20Start&amp;referringTitle=Home">Sample</a></li>
<li>Generates error message from your validation rules, but allows for easy overriding and customization of individual messages. Support for localization of error messages.</li>
<li>Validation Catalog allows:
<ul>
<li>Auto discovery of specifications means the developer isn&#8217;t required to resolve which validation rules to use</li>
<li>Programatically add or change validation rules at runtime</li>
<li><a href="http://specexpress.codeplex.com/wikipage?title=ValidationContexts&amp;referringTitle=Home">Validation Contexts</a></li>
</ul>
</li>
<li>Support for rich, complex object types and graphs</li>
<li>Built with extension and customization in mind</li>
<li>Easy to integrate into your existing code because there are no Base Classes or Attributes to inject into your code</li>
<li>ASP.NET WebForms support</li>
<li>ASP.NET MVC support</li>
<li>Silverlight support</li>
<li>A rich set of <a href="http://specexpress.codeplex.com/wikipage?title=Validators&amp;referringTitle=Home">Validators</a></li>
</ul>
<p>Página do projecto no Codeplex em <a href="http://specexpress.codeplex.com/">http://specexpress.codeplex.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/09/11/specexpress-a-fluent-validation-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sentinel &#8211; a lightweight monitoring system</title>
		<link>http://blog.tiagosalgado.com/2011/07/14/sentinel-a-lightweight-monitoring-system/</link>
		<comments>http://blog.tiagosalgado.com/2011/07/14/sentinel-a-lightweight-monitoring-system/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 21:18:23 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/?p=792</guid>
		<description><![CDATA[Sentinel is a lightweight monitoring system for reporting, analyzing, and automatically diagnosing application performance. Lightweight server monitoring with no agents. See data online in minutes. Instantly diagnose errors, hangs, and slowdowns. Detailed, intuitive, fully historical track record of application performance. Podem ver mais informações em http://leanserver.com/sentinel]]></description>
			<content:encoded><![CDATA[<p><img src="http://img714.imageshack.us/img714/5112/robotc.png" alt="sentinel" /></p>
<blockquote><p><a href="http://leanserver.com/sentinel" target="_blank"> Sentinel</a> is a lightweight monitoring system for reporting, analyzing, and automatically diagnosing application performance.</p>
<ul>
<li>Lightweight server monitoring with no agents.</li>
<li>See data online in minutes.</li>
<li>Instantly diagnose errors, hangs, and slowdowns.</li>
<li>Detailed, intuitive, fully historical track record of application performance.</li>
</ul>
</blockquote>
<div>Podem ver mais informações em <a href="http://leanserver.com/sentinel">http://leanserver.com/sentinel</a></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/07/14/sentinel-a-lightweight-monitoring-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Menubar e web.sitemap</title>
		<link>http://blog.tiagosalgado.com/2011/05/11/jquery-menubar-e-web-sitemap/</link>
		<comments>http://blog.tiagosalgado.com/2011/05/11/jquery-menubar-e-web-sitemap/#comments</comments>
		<pubDate>Wed, 11 May 2011 21:37:16 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/jquery-menubar-e-web-sitemap/</guid>
		<description><![CDATA[Após o HTML 5 Microsoft WebCamp Portugal, surgiu-me algum interesse em explorar o plugin Menubar. Este plugin transforma uma lista num menu bastante agradável, e como tal, gostava de o implementar num projecto em que utilizo o web.sitemap. Para tal, precisei de recorrer a um XLST para transformar o web.sitemap, que não é mais que]]></description>
			<content:encoded><![CDATA[<p>Após o HTML 5 Microsoft WebCamp Portugal, surgiu-me algum interesse em explorar o plugin <a href="http://wiki.jqueryui.com/w/page/38666403/Menubar">Menubar</a>.</p>
<p>Este plugin transforma uma lista num menu bastante agradável, e como tal, gostava de o implementar num projecto em que utilizo o web.sitemap.</p>
<p>Para tal, precisei de recorrer a um XLST para transformar o web.sitemap, que não é mais que um XML, numa lista no formato que o Menubar necessita.</p>
<p>Segue então um exemplo do web.sitemap:</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;    <br />&lt;siteMap xmlns=&quot;<a href="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;">http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;</a>&gt;     <br />&#160;&#160;&#160; &lt;siteMapNode url=&quot;~/&quot; title=&quot;Home&quot; description=&quot;Home&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;siteMapNode url=&quot;&quot; title=&quot;Menu 1&quot; description=&quot;Menu 1&quot; &gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;siteMapNode url=&quot;<a href="http://www.google.pt&quot;">http://www.google.pt&quot;</a> title=&quot;Submenu 1&quot; description=&quot;Submenu 1&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/siteMapNode&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;siteMapNode url=&quot;&quot; title=&quot;Menu 2&quot; description=&quot;Menu 2&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;siteMapNode url=&quot;<a href="http://www.microsoft.com&quot;">http://www.microsoft.com&quot;</a> title=&quot;Submenu 2&quot; description=&quot;Submenu 2&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;siteMapNode url=&quot;<a href="http://www.apple.com&quot;">http://www.apple.com&quot;</a> title=&quot;Submenu 3&quot; description=&quot;Submenu&#160; 3&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/siteMapNode&gt;     <br />&#160;&#160;&#160; &lt;/siteMapNode&gt;     <br />&lt;/siteMap&gt;</p>
<p>Para transformar o XML numa lista, usei o seguinte XSLT</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;    <br />&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform&quot;">http://www.w3.org/1999/XSL/Transform&quot;</a> xmlns:map=&quot;<a href="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;">http://schemas.microsoft.com/AspNet/SiteMap-File-1.0&quot;</a>     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; exclude-result-prefixes=&quot;map&quot;&gt;     <br />&#160; &lt;xsl:output method=&quot;xml&quot; encoding=&quot;utf-8&quot; indent=&quot;yes&quot;/&gt;</p>
<p>&#160; &lt;xsl:template match=&quot;map:siteMapNode&quot;&gt;    <br />&#160;&#160;&#160; &lt;li&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;a href=&quot;{@url}&quot; title=&quot;{@description}&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsl:value-of select=&quot;@title&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;/a&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;xsl:if test=&quot;map:siteMapNode&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ul&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsl:call-template name=&quot;mapNode&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ul&gt;     <br />&#160;&#160;&#160;&#160;&#160; &lt;/xsl:if&gt;     <br />&#160;&#160;&#160; &lt;/li&gt;     <br />&#160; &lt;/xsl:template&gt;</p>
<p>&#160; &lt;xsl:template name=&quot;mapNode&quot; match=&quot;/*/*&quot;&gt;    <br />&#160;&#160;&#160; &lt;xsl:apply-templates/&gt;     <br />&#160; &lt;/xsl:template&gt;     <br />&lt;/xsl:stylesheet&gt;</p>
<p>Desta forma, irei obter uma lista igual à seguinte:</p>
<p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot; ?&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;&quot; title=&quot;Menu 1&quot;&gt;Menu 1&lt;/a&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ul&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;<a href="http://www.google.pt&quot;">http://www.google.pt&quot;</a> title=&quot;Submenu 1&quot;&gt;Submenu 1&lt;/a&gt;&lt;/li&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ul&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/li&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;&quot; title=&quot;Menu 2&quot;&gt;Menu 2&lt;/a&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ul&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;<a href="http://www.microsoft.com&quot;">http://www.microsoft.com&quot;</a> title=&quot;Submenu 2&quot;&gt;Submenu 2&lt;/a&gt;&lt;/li&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;<a href="http://www.apple.com&quot;">http://www.apple.com&quot;</a> title=&quot;Submenu&#160; 3&quot;&gt;Submenu 3&lt;/a&gt;&lt;/li&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/ul&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/li&gt;</p>
<p>Por fim, basta-nos adicionar um controlo XML que irá fazer o render da lista.</p>
<p>&lt;ul id=&quot;bar1&quot; class=&quot;menubar&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:Xml runat=&quot;server&quot; ID=&quot;xmlSiteMapViewer&quot; DocumentSource=&quot;~/web.sitemap&quot; TransformSource=&quot;~/sitemap.xslt&quot; /&gt;     <br />&#160;&#160;&#160; &lt;/ul&gt;</p>
<p>A inserção do controlo entre uma “unordered list” foi propositado, pois só assim é que teremos o menu a funcionar correctamente e teremos um resultado identico ao que está no seguinte site:</p>
<p><a href="http://view.jqueryui.com/master/demos/menubar/default.html">http://view.jqueryui.com/master/demos/menubar/default.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/05/11/jquery-menubar-e-web-sitemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Membership Lock User</title>
		<link>http://blog.tiagosalgado.com/2011/05/02/asp-net-membership-lock-user/</link>
		<comments>http://blog.tiagosalgado.com/2011/05/02/asp-net-membership-lock-user/#comments</comments>
		<pubDate>Mon, 02 May 2011 12:58:23 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/asp-net-membership-lock-user/</guid>
		<description><![CDATA[Visto que não temos uma forma directa de indicar que determinado utilizador irá estar bloqueado, a única forma que arranjei para o fazer foi forçar o erro no login múltiplas vezes, até atingir o valor máximo de tentativas definidas no atributo “maxInvalidPasswordAttempts”. Quando usamos o Membership do ASP.NET, no web.config teremos algo como: &#60;add name=&#34;AspNetSqlMembershipProvider&#34;]]></description>
			<content:encoded><![CDATA[<p>Visto que não temos uma forma directa de indicar que determinado utilizador irá estar bloqueado, a única forma que arranjei para o fazer foi forçar o erro no login múltiplas vezes, até atingir o valor máximo de tentativas definidas no atributo “maxInvalidPasswordAttempts”.</p>
<p>Quando usamos o Membership do ASP.NET, no web.config teremos algo como:</p>
<p>&lt;add name=&quot;AspNetSqlMembershipProvider&quot; </p>
<p>type=&quot;System.Web.Security.SqlMembershipProvider&quot; </p>
<p>connectionStringName=&quot;MyAppConnectionString&quot; </p>
<p>enablePasswordRetrieval=&quot;false&quot; </p>
<p>enablePasswordReset=&quot;true&quot; </p>
<p>requiresQuestionAndAnswer=&quot;false&quot; </p>
<p>requiresUniqueEmail=&quot;false&quot; </p>
<p>maxInvalidPasswordAttempts=&quot;5&quot; </p>
<p>minRequiredPasswordLength=&quot;6&quot; </p>
<p>minRequiredNonalphanumericCharacters=&quot;0&quot; </p>
<p>passwordAttemptWindow=&quot;10&quot; applicationName=&quot;MyAppName&quot; /&gt;</p>
<p>O código que utilizo é então o seguinte:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:7b992993-3bdb-4e84-a36b-2b56774e9723" class="wlWriterEditableSmartContent">
<pre name="code" class="c#">public static bool LockUser(MembershipUser user)
{
    try
    {
        for (int i = 0; i &lt; Membership.MaxInvalidPasswordAttempts; i++)
            Membership.ValidateUser(user.UserName, "thisisandummypasswordonlytolocktheuser");

        return user.IsLockedOut;
    }
    catch (Exception)
    {
        throw;
    }

}</pre>
</div>
<p>Espero que seja util. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/05/02/asp-net-membership-lock-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Silk</title>
		<link>http://blog.tiagosalgado.com/2011/04/29/project-silk/</link>
		<comments>http://blog.tiagosalgado.com/2011/04/29/project-silk/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 13:48:03 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/project-silk/</guid>
		<description><![CDATA[Project Silk provides guidance for building cross-browser web applications with a focus on client-side interactivity. These applications take advantage of the latest web standards like HTML5, CSS3 and ECMAScript 5 along with modern web technologies such as jQuery, Internet Explorer 9, and ASP.NET MVC3. To illustrate this guidance, the project includes a reference implementation called]]></description>
			<content:encoded><![CDATA[<p><a href="http://silk.codeplex.com/" target="_blank">Project Silk</a> provides guidance for building cross-browser web applications with a focus on client-side interactivity. These applications take advantage of the latest web standards like HTML5, CSS3 and ECMAScript 5 along with modern web technologies such as jQuery, Internet Explorer 9, and ASP.NET MVC3.</p>
<p>To illustrate this guidance, the project includes a reference implementation called Mileage Stats that enables its users to track various metrics about their vehicles and fill-ups. Much of the effort in building Mileage Stats was applied to the usability and interactivity of the experience. Animations were included to enhance the enjoyment of the site and AJAX is used to keep the interface responsive and immersive. A great deal of care was also taken to ensure the client-side JavaScript facilitates modularity and maintainability. To accomplish these design goals, the JavaScript code was structured into “widgets” that benefit from the jQuery UI Widget Factory.</p>
<p>Mais informações em <a title="http://silk.codeplex.com/" href="http://silk.codeplex.com/">http://silk.codeplex.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/04/29/project-silk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlar Menus visiveis com o web.sitemap</title>
		<link>http://blog.tiagosalgado.com/2011/04/14/controlar-menus-visiveis-com-o-web-sitemap/</link>
		<comments>http://blog.tiagosalgado.com/2011/04/14/controlar-menus-visiveis-com-o-web-sitemap/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 12:52:21 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/controlar-menus-visiveis-com-o-web-sitemap/</guid>
		<description><![CDATA[Uma maneira rápida de ter um menu a funcionar no nosso website, é recorrer ao controlo Menu e associá-lo a um web.sitemap usando o SiteMapDataSource. Exemplo do ficheiro web.sitemap: &#60;?xml version="1.0" encoding="utf-8" ?&#62; &#60;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" &#62;     &#60;siteMapNode  url="~/" title="Home"  description="Home" &#62;         &#60;siteMapNode url="" description="Menu 1" title="Menu 1"&#62;             &#60;siteMapNode url="" description="SubMenu 1" title="Sub Menu 1"/&#62;         &#60;/siteMapNode&#62;         &#60;siteMapNode url="" description="Menu 2" title="Menu 2"/&#62;         &#60;siteMapNode url="" description="Menu 3" title="Menu 3"/&#62;     &#60;/siteMapNode&#62; &#60;/siteMap&#62; Exemplo do código para adicionar na página o menu: &#60;asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"      EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal"      DataSourceID="SiteMapDataSource1" onmenuitemdatabound="NavigationMenu_MenuItemDataBound"&#62; &#60;/asp:Menu&#62; &#60;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"  ShowStartingNode="false" /&#62; Correndo a]]></description>
			<content:encoded><![CDATA[<p>Uma maneira rápida de ter um menu a funcionar no nosso website, é recorrer ao controlo Menu e associá-lo a um web.sitemap usando o SiteMapDataSource.</p>
<p>Exemplo do ficheiro web.sitemap:</p>
<pre>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" &gt;
    &lt;siteMapNode  url="~/" title="Home"  description="Home" &gt;
        &lt;siteMapNode url="" description="Menu 1" title="Menu 1"&gt;
            &lt;siteMapNode url="" description="SubMenu 1" title="Sub Menu 1"/&gt;
        &lt;/siteMapNode&gt;
        &lt;siteMapNode url="" description="Menu 2" title="Menu 2"/&gt;
        &lt;siteMapNode url="" description="Menu 3" title="Menu 3"/&gt;
    &lt;/siteMapNode&gt;
&lt;/siteMap&gt;</pre>
<p>Exemplo do código para adicionar na página o menu:</p>
<pre>
<pre>&lt;asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" 
    EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal" 
    DataSourceID="SiteMapDataSource1" onmenuitemdatabound="NavigationMenu_MenuItemDataBound"&gt;
&lt;/asp:Menu&gt;
&lt;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"  ShowStartingNode="false" /&gt;</pre>
</pre>
<p>Correndo a aplicação, iremos ter algo como a próxima imagem:</p>
<p><img src="http://img576.imageshack.us/img576/1593/menu1rc.png" alt="" width="454" height="143" /></p>
<p>Para mostrar ou esconder os menus, consoante o tipo de acesso de cada utilizador, podemos definir as Roles em cada SiteMapNode.</p>
<p>Outra forma de controlar os menus visiveis, é adicionar um atributo em cada SiteMapNode e consoante o seu valor, irá ou não mostrar cada um dos menus.</p>
<p>Para isso, o web.sitemap será algo como:</p>
<pre>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"&gt;
  &lt;siteMapNode url="~/" title="Home" description="Home" visible="true"&gt;
    &lt;siteMapNode url="" description="Menu 1" title="Menu 1" visible="true"&gt;
      &lt;siteMapNode url="" description="SubMenu 1" title="Sub Menu 1" visible="true" /&gt;
    &lt;/siteMapNode&gt;
    &lt;siteMapNode url="" description="Menu 2" title="Menu 2" visible="False" /&gt;
    &lt;siteMapNode url="" description="Menu 3" title="Menu 3" visible="true" /&gt;
  &lt;/siteMapNode&gt;
&lt;/siteMap&gt;</pre>
</pre>
<p>O atributo “visible” é que nos vai indicar se o menu é ou não mostrado, e para isso vamos adicionar ao evento MenuItemDataBound do Menu o seguinte código:</p>
<pre>
<pre>protected void NavigationMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{
    SiteMapNode node = e.Item.DataItem as SiteMapNode;
    if (!string.IsNullOrEmpty(node["visible"]))
    {
        bool isVisible;
        if (bool.TryParse(node["visible"], out isVisible))
        {
            if (!isVisible)
            {
                if (e.Item.Parent != null)
                    e.Item.Parent.ChildItems.Remove(e.Item);
                else
                    ((Menu)sender).Items.Remove(e.Item);
            }
        }
    }
}</pre>
</pre>
<p>Desta forma, teremos o nosso menu a mostrar todos os nós cujo valor do atributo Visible seja igual a True.</p>
<p>Para podermos controlar directamente os menus que irão estar ou não visiveis, utilizei uma Treeview para carregar o ficheiro web.sitemap, definir que todos os items mostrarão uma checkbox, que irá indicar o estado do atributo Visible.</p>
<pre>
<pre>&lt;asp:TreeView runat="server" ID="tvMenus" AutoGenerateDataBindings="False" DataSourceID="XmlDsSiteMap"
    OnTreeNodeCheckChanged="tvMenus_TreeNodeCheckChanged" ShowCheckBoxes="All" ShowLines="True"
    OnTreeNodeDataBound="tvMenus_TreeNodeDataBound"&gt;
    &lt;DataBindings&gt;
        &lt;asp:TreeNodeBinding DataMember="siteMapNode" SelectAction="None" ShowCheckBox="True"
            TextField="title" /&gt;
        &lt;asp:TreeNodeBinding DataMember="siteMapNode" TextField="title" /&gt;
        &lt;asp:TreeNodeBinding DataMember="siteMapNode" TextField="title" /&gt;
        &lt;asp:TreeNodeBinding DataMember="siteMap" /&gt;
    &lt;/DataBindings&gt;
&lt;/asp:TreeView&gt;
&lt;asp:XmlDataSource ID="XmlDsSiteMap" runat="server" DataFile="~/Web.sitemap" XPath="/*/*/*"&gt;
&lt;/asp:XmlDataSource&gt;
    &lt;p&gt;
        &lt;asp:Button runat="server" ID="btn" Text="gravar" OnClick="btn_Click" /&gt;&lt;/p&gt;</pre>
</pre>
<p>&nbsp;</p>
<pre>
<pre>protected void tvMenus_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
    XmlElement node = e.Node.DataItem as XmlElement;
    if (node.Attributes["visible"] != null)
    {
        if (!string.IsNullOrEmpty(node.Attributes["visible"].Value))
        {
            bool isVisible;
            if (bool.TryParse(node.Attributes["visible"].Value, out isVisible))
            {
                e.Node.Checked = isVisible;
            }
            else
                e.Node.Checked = true;
        }
        else
            e.Node.Checked = true;
    }
}</pre>
</pre>
<p><img src="http://img828.imageshack.us/img828/8241/menu2f.png" alt="" width="396" height="276" /></p>
<p>Por fim, para gravarmos as alterações do atributo consoante o estado da checkbox, adicionamos ao evento TreeNodeCheckChanged da Treeview o seguinte código:</p>
<pre>
<pre>protected void tvMenus_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
{
    XmlDsSiteMap.GetXmlDocument().SelectSingleNode(e.Node.DataPath).Attributes["visible"].Value = e.Node.Checked.ToString();
}</pre>
</pre>
<p>E ao botão que adicionamos para gravar as alterações o seguinte código:</p>
<pre>
<pre>protected void btn_Click(object sender, EventArgs e)
{
    XmlDsSiteMap.Save();
}</pre>
</pre>
<p>Agora é só activar e desactivar os items ao nosso gosto.</p>
<p><img src="http://img828.imageshack.us/img828/543/menu3x.png" alt="" width="356" height="271" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/04/14/controlar-menus-visiveis-com-o-web-sitemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GridView ShowHeaderWhenEmpty</title>
		<link>http://blog.tiagosalgado.com/2011/03/26/gridview-showheaderwhenempty/</link>
		<comments>http://blog.tiagosalgado.com/2011/03/26/gridview-showheaderwhenempty/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 16:29:00 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/gridview-showheaderwhenempty/</guid>
		<description><![CDATA[Até à versão 3.5 da .NET Framework, para mostrarmos os cabeçalhos de uma gridview quando esta não iria conter qualquer resultado, teriamos que recorrer a soluções como esta por exemplo: List&#60;string&#62; rows = new List&#60;string&#62;( new string[] { &#34;line1&#34;, &#34;line2&#34;, &#34;line3&#34; }); rows.Clear(); if (rows.Count &#62; 0) { gv.DataSource = rows; gv.DataBind(); } else {]]></description>
			<content:encoded><![CDATA[<p>Até à versão 3.5 da .NET Framework, para mostrarmos os cabeçalhos de uma gridview quando esta não iria conter qualquer resultado, teriamos que recorrer a soluções como esta por exemplo:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:5b640521-0a18-4ecb-93b4-b7b2456090ad" class="wlWriterSmartContent">
<pre class="c#" name="code">List&lt;string&gt; rows = new List&lt;string&gt;(
    new string[] { &quot;line1&quot;, &quot;line2&quot;, &quot;line3&quot; });

rows.Clear();
if (rows.Count &gt; 0)
{
    gv.DataSource = rows;
    gv.DataBind();
}
else
{
    rows.Add(&quot;&quot;);
    gv.DataSource = rows;
    gv.DataBind();
    gv.Rows[0].Visible = false;
}</pre>
</div>
<p>Como é obvio, isto vai sempre executar a condição “else”, mas é apenas para exemplificar como forçar a apresentação do Header na GridView mesmo que o Datasource não contenha qualquer registo.</p>
<p>Na versão 4.0, foi introduzida uma nova propriedade que faz com que o Header seja sempre apresentado sem recorrer a este tipo de truques. A propriedade é a ShowHeaderWhenEmpty.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:c7842711-cfde-4108-9c7d-0bb732a7c6a7" class="wlWriterSmartContent">
<pre class="c#:showcolumns" name="code">&lt;asp:GridView runat=&quot;server&quot; ID=&quot;gv&quot; ShowHeaderWhenEmpty=&quot;true&quot;&gt;
&lt;/asp:GridView&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/03/26/gridview-showheaderwhenempty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EISK–Employee Info Starter Kit 5.0</title>
		<link>http://blog.tiagosalgado.com/2011/03/13/eiskemployee-info-starter-kit-5-0/</link>
		<comments>http://blog.tiagosalgado.com/2011/03/13/eiskemployee-info-starter-kit-5-0/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 15:52:36 +0000</pubDate>
		<dc:creator>Tiago Salgado</dc:creator>
				<category><![CDATA[Sem categoria]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[codeplex]]></category>

		<guid isPermaLink="false">http://blog.tiagosalgado.com/eiskemployee-info-starter-kit-5-0/</guid>
		<description><![CDATA[Employee Info Starter Kit is an open source project that is highly influenced by the concept ‘Pareto Principle’ or 80-20 rule, where it is targeted to enable a web developer to gain 80% productivity with 20% of effort with respect to learning curve and production. It is intended to address different types of real world]]></description>
			<content:encoded><![CDATA[<blockquote><p>Employee Info Starter Kit is an open source project that is highly influenced by the concept ‘Pareto Principle’ or 80-20 rule, where it is targeted to enable a web developer to gain 80% productivity with 20% of effort with respect to learning curve and production.      <br />It is intended to address different types of real world challenges faced by web application developers when performing common CRUD operations. Using a single database table ‘Employee’, the current release illustrates how to utilize Microsoft ASP.NET 4.0 Web Form Data Controls, Entity Framework 4.0 and Visual Studio 2010 effectively in that context.</p>
</blockquote>
<p>&#160;</p>
<p>Mais informações <a href="http://eisk.codeplex.com/" target="_blank">no site do projecto no codeplex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tiagosalgado.com/2011/03/13/eiskemployee-info-starter-kit-5-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

