<?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>blog.dervalp.com &#187; Url</title>
	<atom:link href="http://blog.dervalp.com/tag/url/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dervalp.com</link>
	<description>Think before Programming (Public learning)</description>
	<lastBuildDate>Sat, 20 Mar 2010 22:22:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET MVC : Url Helper Extension CSS, Javascript, Picture</title>
		<link>http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/</link>
		<comments>http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:16:56 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Url]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=303</guid>
		<description><![CDATA[Here a url helper, maybe it can interests you :


public static class UrlHelperExtension
{
public static string Image(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&#34;~/Content/Images/{0}&#34;,fileName));
}

public static string Stylesheet(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&#34;~/Content/Css/{0}.css&#34;,fileName));
}

public static string Javascript(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&#34;~/Content/Scripts/{0}.js&#34;, fileName));
}
}

And here is how I use it :
For CSS :


&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; href=&#34;&#60;%= Url.Stylesheet(&#34;reset&#34;) %&#62;&#34; media=&#34;all&#34; /&#62;

For javascript


&#60;script [...]]]></description>
			<content:encoded><![CDATA[<p>Here a url helper, maybe it can interests you :</p>
<pre class="brush: c;">

public static class UrlHelperExtension
{
public static string Image(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&quot;~/Content/Images/{0}&quot;,fileName));
}

public static string Stylesheet(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&quot;~/Content/Css/{0}.css&quot;,fileName));
}

public static string Javascript(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format(&quot;~/Content/Scripts/{0}.js&quot;, fileName));
}
}
</pre>
<p>And here is how I use it :</p>
<p>For CSS :</p>
<pre class="brush: html;">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;%= Url.Stylesheet(&quot;reset&quot;) %&gt;&quot; media=&quot;all&quot; /&gt;
</pre>
<p>For javascript</p>
<pre class="brush: html;">

&lt;script src=&quot;&lt;%= Url.Javascript(&quot;jquery-1.3.2.min&quot;) %&gt;&quot; type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
</pre>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d303').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d303" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;title=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;title=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;title=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;title=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;title=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture+@+http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/&amp;t=ASP.NET+MVC+%3A+Url+Helper+Extension+CSS%2C+Javascript%2C+Picture" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d303').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d303').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/29/aspnet-mvc-url-helper-extension-css-javascript-picture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
