<?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>Aneef.Net &#187; Youtube</title>
	<atom:link href="http://www.aneef.net/tag/youtube/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aneef.net</link>
	<description>Do it in .Net way &#124; Blogging about C#,ASP.Net, LINQ,WPF and .Net Technologies</description>
	<lastBuildDate>Tue, 29 Nov 2011 13:18:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Youtube Helper for ASP.Net WebMatrix [UPDATED For Beta 2]</title>
		<link>http://www.aneef.net/2010/10/05/youtube-helper-for-asp-net-webmatrix/</link>
		<comments>http://www.aneef.net/2010/10/05/youtube-helper-for-asp-net-webmatrix/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 16:34:00 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[WebMatrix]]></category>
		<category><![CDATA[Helper]]></category>
		<category><![CDATA[Razor]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=141</guid>
		<description><![CDATA[THIS POST IS UPDATED TO WORK WITH WEBMATRIX BETA 2 ASP.Net WebMatrix is a lightweight web development tool that contains IIS Express, SQL CE 4.0 and ASP.Net Web Pages with Razor Syntax. to learn more about ASP.Net WebMatrix read this excellent tutorial. The ASP.Net Web pages ships with some really cool helpers like easy database [...]]]></description>
			<content:encoded><![CDATA[<p></p><blockquote><p><strong>THIS POST IS UPDATED TO WORK WITH WEBMATRIX BETA 2</strong></p></blockquote>
<p><a href="http://www.asp.net/webmatrix" target="_blank">ASP.Net WebMatrix</a> is a lightweight web development tool that contains IIS Express, SQL CE 4.0 and ASP.Net Web Pages with Razor Syntax. to learn more about ASP.Net WebMatrix read this excellent <a href="http://www.asp.net/webmatrix/tutorials/1-getting-started-with-webmatrix-and-asp-net-web-pages">tutorial</a>.</p>
<p>The ASP.Net Web pages ships with some really cool helpers like easy database access, Twitter profile, &amp; Facebook like button.  and it also allows us to create our own helpers. in the current beta release of the WebMatrix there are 2 ways to create a helper:</p>
<ol>
<li>Using a visual studio class library (Recommended).</li>
<li>Use .cs file in the App_Code directory in the WebMatrix project folder.</li>
</ol>
<p>In this post I&#8217;m going to show you how to create a Helper to add <a href="http://www.youtube.com">Youtube </a>Videos to your WebMatrix pages. as you know a helper needs to be a static class. here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.Mvc</span><span style="color: #008000;">;</span> 
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.WebPages</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.Helpers</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> MyHelpers
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> IHtmlString Youtube<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> link, <span style="color: #6666cc; font-weight: bold;">int</span> width <span style="color: #008000;">=</span> <span style="color: #FF0000;">480</span>, <span style="color: #6666cc; font-weight: bold;">int</span> height <span style="color: #008000;">=</span> <span style="color: #FF0000;">385</span>, <span style="color: #6666cc; font-weight: bold;">bool</span> allowFullScreen <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> innerHtml <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
        var url <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;http://www.youtube.com/v/{0}?fs=1&amp;amp;hl=en_US&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">//prepare video embed URL</span>
        var uri <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>link<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        var querystring <span style="color: #008000;">=</span> uri<span style="color: #008000;">.</span><span style="color: #0000FF;">Query</span><span style="color: #008000;">;</span>
        var videoCode <span style="color: #008000;">=</span> HttpUtility<span style="color: #008000;">.</span><span style="color: #0000FF;">ParseQueryString</span><span style="color: #008000;">&#40;</span>querystring<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Get</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;v&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        url <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span>url, videoCode<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">//prepare HTML</span>
        var html <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TagBuilder<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;object&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        html<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;width&quot;</span>, width<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        html<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;height&quot;</span>, height<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        var param1 <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TagBuilder<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;param&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param1<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;name&quot;</span>, <span style="color: #666666;">&quot;movie&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param1<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;value&quot;</span>, url, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        var param2 <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TagBuilder<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;param&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param2<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;name&quot;</span>, <span style="color: #666666;">&quot;allowFullScreen&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param2<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;value&quot;</span>, allowFullScreen<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        var param3 <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TagBuilder<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;param&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param3<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;name&quot;</span>, <span style="color: #666666;">&quot;allowscriptaccess&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        param3<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;value&quot;</span>, <span style="color: #666666;">&quot;always&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        var embed <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TagBuilder<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;embed&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;src&quot;</span>, url, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;type&quot;</span>, <span style="color: #666666;">&quot;application/x-shockwave-flash&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;allowscriptaccess&quot;</span>, <span style="color: #666666;">&quot;always&quot;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;allowfullscreen&quot;</span>, allowFullScreen<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;width&quot;</span>, width<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        embed<span style="color: #008000;">.</span><span style="color: #0000FF;">MergeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;height&quot;</span>, height<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        innerHtml <span style="color: #008000;">+=</span> param1<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>TagRenderMode<span style="color: #008000;">.</span><span style="color: #0000FF;">SelfClosing</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        innerHtml <span style="color: #008000;">+=</span> param2<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>TagRenderMode<span style="color: #008000;">.</span><span style="color: #0000FF;">SelfClosing</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        innerHtml <span style="color: #008000;">+=</span> param3<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>TagRenderMode<span style="color: #008000;">.</span><span style="color: #0000FF;">SelfClosing</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        innerHtml <span style="color: #008000;">+=</span> embed<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>TagRenderMode<span style="color: #008000;">.</span><span style="color: #0000FF;">SelfClosing</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        html<span style="color: #008000;">.</span><span style="color: #0000FF;">InnerHtml</span> <span style="color: #008000;">=</span> innerHtml<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">new</span> HtmlString<span style="color: #008000;">&#40;</span>html<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span>TagRenderMode<span style="color: #008000;">.</span><span style="color: #0000FF;">Normal</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Few things to note in the above code.  i have referenced <a href="http://msdn.microsoft.com/en-us/library/dd492706.aspx" target="_blank">System.Web.Mvc</a> to use the <a href="http://www.asp.net/mvc/tutorials/using-the-tagbuilder-class-to-build-html-helpers-cs" target="_blank">TagBuilder</a> to create safe html, and System.Web.Helpers to create the helper. the second one, you can find in C:\program files\Microsfoft ASP.Net (or ASP.net installation directory).</p>
<p>And I&#8217;m using the <a href="http://msdn.microsoft.com/en-us/library/system.web.httputility.aspx" target="_blank">System.Web.HttpUtility</a> here to extract a query string from a Uri.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">        <span style="color: #008080; font-style: italic;">//prepare video embed URL</span>
        var uri <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span>link<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        var querystring <span style="color: #008000;">=</span> uri<span style="color: #008000;">.</span><span style="color: #0000FF;">Query</span><span style="color: #008000;">;</span>
        var videoCode <span style="color: #008000;">=</span> HttpUtility<span style="color: #008000;">.</span><span style="color: #0000FF;">ParseQueryString</span><span style="color: #008000;">&#40;</span>querystring<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Get</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;v&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>I use the above code to convert the Youtube public link to the actual video link.</p>
<p>And since my code needs to return an html which should not be html encoded again. my methods return type is <a href="http://msdn.microsoft.com/en-us/library/system.web.ihtmlstring.aspx" target="_blank">IHtmlstring</a>. using this tells the ASP.Net pages not to encoded this html again, as this is already encoded.</p>
<p>Now create the folder App_Code in your WebMatrix Project, and create a file named MyHelpers.cs and paste the code above in that.</p>
<p>Now you can use this in your WebPages like this to embed youtube videos in your pages:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">  @MyHelpers<span style="color: #008000;">.</span><span style="color: #0000FF;">Youtube</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;http://www.youtube.com/watch?v=ulzLU3At3lA&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Other parameters such as width,height are optional as you can notice we have used optional parameters.</p>
<p><strong>UPDATE</strong>S for beta 2:</p>
<ol>
<li>In beta 1 WebPages were in Microsoft.WebPages. but in WebMatrix beta 2 its moved to System.Web.WebPages</li>
<li>I had to copy System.Web.Mvc.dll to the bin directory of WebMatrix project to make this workin in WebMatrix beta 2.</li>
</ol>
<p>I Hope it helps</p>
<p>Aneef</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2010/10/05/youtube-helper-for-asp-net-webmatrix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SCRUM- Quick Guide</title>
		<link>http://www.aneef.net/2009/11/11/scrum-quick-guide/</link>
		<comments>http://www.aneef.net/2009/11/11/scrum-quick-guide/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 07:32:23 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[Methodologies]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SCRUM]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=111</guid>
		<description><![CDATA[I just thought to share this two videos i found in youtube, which is very useful for those who want to learn about SCRUM methodology, wikipedia: Scrum is an iterative incremental framework for managing complex work (such as new product development) commonly used with agile software development. for more info read here. SCRUM Basics by [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I just thought to share this two videos i found in youtube, which is very useful for those who want to learn about SCRUM methodology, <em>wikipedia: <strong>Scrum</strong> is an iterative incremental framework for managing complex work (such as new product development) commonly used with <a title="Agile software development" href="http://en.wikipedia.org/wiki/Agile_software_development">agile software development</a>. </em>for more info read <a href="http://en.wikipedia.org/wiki/Scrum_%28development%29" target="_blank">here</a>.<em> </em></p>
<p><strong>SCRUM Basics by Orjan Hillbom</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vmGMpME_phg&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/vmGMpME_phg&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>SCRUM in Under 10 Minutes (HD) by @hamids</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Q5k7a9YEoUI&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/Q5k7a9YEoUI&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/11/11/scrum-quick-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.aneef.net @ 2012-02-04 23:25:41 by W3 Total Cache -->
