<?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; ASP.Net</title>
	<atom:link href="http://www.aneef.net/category/dotnet-framework/aspnet/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>My Presentation on ASP.Net WebMatrix for .Net User Group Meeting.</title>
		<link>http://www.aneef.net/2010/10/08/my-presentation-on-asp-net-webmatrix-for-net-user-group-meeting/</link>
		<comments>http://www.aneef.net/2010/10/08/my-presentation-on-asp-net-webmatrix-for-net-user-group-meeting/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:39:06 +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[ASP.net]]></category>
		<category><![CDATA[Slide Deck]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=163</guid>
		<description><![CDATA[Last Thursday i did a presentation on ASP.Net WebMatrix in the .Net User Group meeting held in Colombo.  so thought of  sharing the presentation with you all. there were some code demos also, but unfortunately i couldn&#8217;t upload them. if anyone is interested you can download and view the presentation in the link below or [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Last Thursday i did a presentation on ASP.Net WebMatrix in the .Net User Group meeting held in Colombo.  so thought of  sharing the presentation with you all. there were some code demos also, but unfortunately i couldn&#8217;t upload them. if anyone is interested you can download and view the presentation in the link below or view it in the Scribd document.</p>
<p>I must thank <a href="http://msjoe.com">Joe Stagner</a> from microsoft for his ScreenCasts and Presentation on WebMatrix, which were very helpful for me to prepare my presentation too.</p>
<p><a title="View Introduction to ASP.Net Webmatrix  on Scribd" href="http://www.scribd.com/doc/38973828/Introduction-to-ASP-Net-Webmatrix" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Introduction to ASP.Net Webmatrix </a> <object id="doc_999476862154291" name="doc_999476862154291" height="(auto)" width="450" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" ><param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf"><param name="wmode" value="opaque"><param name="bgcolor" value="#ffffff"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="FlashVars" value="document_id=38973828&#038;access_key=key-1ihae2ucnh16imbmtbnw&#038;page=1&#038;viewMode=slideshow"><embed id="doc_999476862154291" name="doc_999476862154291" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=38973828&#038;access_key=key-1ihae2ucnh16imbmtbnw&#038;page=1&#038;viewMode=slideshow" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="(auto)" width="450" wmode="opaque" bgcolor="#ffffff"></embed></object></p>
<p><a href="http://www.aneef.net/wp-content/uploads/2010/10/webmatrix_session.pptx">Download the Slide Deck here</a></p>
<p>Thanks,</p>
<p>Aneef</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2010/10/08/my-presentation-on-asp-net-webmatrix-for-net-user-group-meeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>FCKEDitor &#8211; FIXED Image Upload dialog hang for .net</title>
		<link>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/</link>
		<comments>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 11:22:53 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[CKEditor]]></category>
		<category><![CDATA[Continous]]></category>
		<category><![CDATA[FCK Editor]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Progress]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=107</guid>
		<description><![CDATA[Well This issue has been bugging alot of people around the net it seems. I&#8217;m one of the victim too *sigh*.. anways bianchi007, a member in the CKSource Site forums had posted a solution. thought it would be worth to share. Here is the solution which was posted in this thread. This is for the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Well This issue has been bugging alot of people around the net it seems. I&#8217;m one of the victim too *sigh*.. anways <a href="http://cksource.com/forums/memberlist.php?mode=viewprofile&amp;u=12108">bianchi007,</a> a member in the <a href="http://cksource.com/Forums/">CKSource </a>Site forums had posted a solution. thought it would be worth to share.</p>
<p>Here is the solution which was posted in <a href="http://cksource.com/forums/viewtopic.php?f=6&amp;t=12112&amp;p=36585&amp;hilit=image+upload#p36585">this thread</a>.</p>
<p>This is for the .net assembly 2_6_3. I based it on the help file <a href="http://dev.fckeditor.net/attachment/ticket/2115/2115.patch">http://dev.fckeditor.net/attachment/tic &#8230; 2115.patch</a></p>
<p>Steps:</p>
<p>Open the FredCK.FCKeditorV2.vs2005.csproj in Visual Studio 2005</p>
<p>Open the file FileBrowser &gt; FileWorkerBase.cs</p>
<p>Go to line 119</p>
<p>Replace:<br />
[sourcecode language="csharp"]<br />
Response.Write( @&quot;(function(){var d=document.domain;while (true){try{var A=window.top.opener.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,&#8221;);if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();&quot; );<br />
[/sourcecode]</p>
<p>Replace with:<br />
[sourcecode language="csharp"]<br />
Response.Write(@&quot;(function(){var d=document.domain;while (true){try{var A=window.parent.OnUploadCompleted;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,&#8221;);if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();&quot;);<br />
[/sourcecode]<br />
Compile the project and then reference the new dll file in your project.</p>
<p>I hope it helps <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.Net 3.5  ListView Control and Book Flip effect</title>
		<link>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/</link>
		<comments>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 08:28:54 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Tricks & Tips]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/</guid>
		<description><![CDATA[one of the coolest control in ASP.Net 3.5 is its Listview Control. its too CSS friendly, and we can use it to achieve many great content presentations. if you go to scottgu&#8217;s blog you can find some good articles on how to use the listview control. recently I did such an implementation. its using the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>one of the coolest control in ASP.Net 3.5 is its <a href="http://msdn.microsoft.com/en-us/library/bb398790.aspx" target="_blank">Listview</a> Control. its too CSS friendly, and we can use it to achieve many great content presentations. if you go to scottgu&#8217;s blog you can find some good articles on <a href="http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx" target="_blank">how to use the listview control</a>. </p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:84c1fa9b-1ab9-4cb7-bd88-7865eb5324e1" class="wlWriterSmartContent">
<div id="120aa13c-244b-4179-b933-42a7c1ab72ae" style="margin: 0px; padding: 0px; display: inline;">
<div><a href="http://www.youtube.com/watch?v=nNnk9chiriU" target="_new"><img src="http://www.aneef.net/wp-content/uploads/2009/04/video83c3c0ada8e7.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('120aa13c-244b-4179-b933-42a7c1ab72ae'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/nNnk9chiriU\&quot;&gt;&lt;\/param&gt;&lt;param name=\&quot;wmode\&quot; value=\&quot;transparent\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/nNnk9chiriU\&quot; type=\&quot;application/x-shockwave-flash\&quot; wmode=\&quot;transparent\&quot; width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt=""></a></div>
</div>
</div>
<p>recently I did such an implementation. its using the <a href="http://www.coastworx.com/bookflip.php" target="_blank">javascript bookflip.</a> a great work by <a href="http://coastworx.com/contact.php" target="_blank">Will</a> (very kind of him to share this to the world). I used the his code, and ListView to achieve a dynamic bookflip.&nbsp; apart from the javascript changes,&nbsp; here is the change I did for the Listview markup.</p>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode"> <span class="kwrd">&lt;</span><span class="html">asp:ListView</span> <span class="attr">id</span><span class="kwrd">="ImageFlip"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ItemPlaceholderID</span><span class="kwrd">="ItemContainer"</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="myBook"</span> <span class="attr">style</span><span class="kwrd">="width: &lt;%# flipWidth*2 %&gt;px; height:</span></pre>
<pre class="csharpcode"><span class="kwrd"> &lt;%# flipHeight %&gt;px; position: relative; z-index: 5;"</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">asp:PlaceHolder</span> <span class="attr">ID</span><span class="kwrd">="ItemContainer"</span>  <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">style</span><span class="kwrd">="border: 0px solid #ddd;
    text-align: center;
    padding-top: 100px;
    margin: 0px;
    height: 0px;
    text-align:inherit;
    background-color: #ffffff;
 color: #cf0000;vertical-align:bottom"</span> <span class="attr">Name</span><span class="kwrd">="Back"</span> <span class="kwrd">&gt;</span> </pre>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="spongebob300/bk.jpg"</span>  <span class="attr">border</span><span class="kwrd">="0"</span> <span class="attr">usemap</span><span class="kwrd">="#Map"</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>

      <span class="kwrd">&lt;/</span><span class="html">div</span> <span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">style</span><span class="kwrd">="background:#ffffff ;color:#ffffff;</span></pre>
<pre class="csharpcode"><span class="kwrd"> cursor:url(ajax/zoom-in.cur),auto; z-index:-&lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;;"</span> </pre>
<pre class="csharpcode"><span class="attr">name</span><span class="kwrd">="Page &lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;"</span> <span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="Javascript:getFullImage(&lt;%#Eval("</span><span class="attr">ID</span><span class="kwrd">") %&gt;)"</span> <span class="kwrd">&gt;</span></pre>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="&lt;%#Eval("</span><span class="attr">FlipImage</span><span class="kwrd">") %&gt;"</span> <span class="attr">alt</span><span class="kwrd">="Page &lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;"</span> </pre>
<pre class="csharpcode">  <span class="attr">border</span><span class="kwrd">="0"</span> <span class="attr">style</span><span class="kwrd">="cursor:url(ajax/zoom-in.cur),auto;"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">asp:ListView</span><span class="kwrd">&gt;</span>
</pre>
<pre class="csharpcode">&nbsp;</pre>
<p>And the Data Retrieval is just as simple as the following 3 lines:</p>
<div class="csharpcode">
<pre class="alt">DataTable dt = db.getFlipPage(catid);</pre>
<pre>ImageFlip.DataSource = dt;</pre>
<pre class="alt">ImageFlip.DataBind();</pre>
</div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>&nbsp;</p>
<p>And that&#8217;s all. very easy isn&#8217;t it. for the real implementation of this go to <a href="http://www.catalogues4u.com.au">www.catalogues4u.com.au</a> and click on a catalogue.In that site I have also implemented a carousel using Listview.&nbsp; hope it helps.</p>
<pre class="csharpcode">&nbsp;</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><br/><br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.aneef.net%2f2009%2f04%2f16%2faspnet-35-listview-control-and-book-flip-effect%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.aneef.net%2f2009%2f04%2f16%2faspnet-35-listview-control-and-book-flip-effect%2f" border="0" alt="kick it on DotNetKicks.com" /></a><br />
<br/><br />
<!--adsense#links--><br/><br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008, C# 3.0, LINQ, ASP.Net 3.5 Getting Started</title>
		<link>http://www.aneef.net/2008/02/18/visual-studio-2008-c-30-linq-aspnet-35-getting-started/</link>
		<comments>http://www.aneef.net/2008/02/18/visual-studio-2008-c-30-linq-aspnet-35-getting-started/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 07:35:52 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2008/02/18/visual-studio-2008-c-30-linq-aspnet-35-getting-started/</guid>
		<description><![CDATA[these days I&#8217;m just playing around with Visual studio 2008 and its new features, C# 3.0 LINQ, Windows Presentation Foundation, Silverlight, ASP.Net 3.5 and much more. And trust me last few months, I have received a lot of emails regarding How to&#8217;s of these and requesting resources to learn these language improvements. well may be [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>these days I&#8217;m just playing around with Visual studio 2008 and its new features, <a href="http://msdn2.microsoft.com/en-us/library/bb308966.aspx" target="_blank">C# 3.0</a> <a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx" target="_blank">LINQ</a>, <a href="http://wpf.netfx3.com/" target="_blank">Windows Presentation Foundation</a>, <a href="http://silverlight.net/" target="_blank">Silverlight</a>, ASP.Net 3.5 and much more. And trust me last few months, I have received a lot of emails regarding How to&#8217;s of these and requesting resources to learn these language improvements. well may be you  wonder why I get these requests while there are a lot of geek&#8217;s outs there.. well trust me I do have some fans!!.</p>
<p>so I decided to help them all out, but I don&#8217;t want to fill the blogsphere with another post of LINQ, WPF or WCF, because its already filled with a lot of articles on them by geek&#8217;s and various people around the world.so what I&#8217;m going to do is post some valuable links on where you can give a kick start on learning these.</p>
<p><center><!--adsense#inpost--></center></p>
<ol>
<li>To get visual studio 2008 read the post <a href="http://www.aneef.net/2007/11/23/visual-studio-2008-orcas-is-here/" target="_blank">here</a>.</li>
<li>The first and best place I would recommend to learn is reading Scott Guthrie&#8217;s web blog. he had written some excellent articles on these new technologies. I would recommend you to subscribe his blogs feeds or book marking his blog for future reference. here is are some valuable articles by him.
<ol>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/01/28/video-using-linq-with-asp-net-in-vs-orcas-part-1.aspx" target="_blank">Using LINQ with ASP.Net in VS 2008</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/02/08/my-first-look-at-orcas-presentation.aspx" target="_blank">Scott Guthrie &#8211; First Look at ORCAS</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/03/08/new-c-orcas-language-features-automatic-properties-object-initializers-and-collection-initializers.aspx" target="_blank">New &#8220;ORCAS&#8221; C# 3.0 Language Features: Automatic Properties, Object Initializers and Collection Initializers</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx" target="_blank">New &#8220;ORCAS&#8221; Language Features : Extension Methods</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx" target="_blank">New &#8220;ORCAS&#8221; Language Features : Lambda Expressions</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/04/21/new-orcas-language-feature-query-syntax.aspx" target="_blank">New &#8220;ORCAS&#8221; Language Features : Query Syntax</a>.</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx" target="_blank">New &#8220;ORCAS&#8221; Language Features :  Anonymous Types</a>.</li>
<li>and the following are Scott&#8217;s posts on LINQ
<ul>
<li>
<ul>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx">Part 1: Introduction to LINQ to SQL</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/05/29/linq-to-sql-part-2-defining-our-data-model-classes.aspx">Part 2: Defining our Data Model Classes</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/06/29/linq-to-sql-part-3-querying-our-database.aspx">Part 3: Querying our Database</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/07/11/linq-to-sql-part-4-updating-our-database.aspx">Part 4: Updating our Database</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx">Part 5: Binding UI using the ASP:LinqDataSource Control</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx">Part 6: Retrieving Data Using Stored Procedures</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/08/23/linq-to-sql-part-7-updating-our-database-using-stored-procedures.aspx">Part 7: Updating our Database using Stored Procedures</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-executing-custom-sql-expressions.aspx">Part 8: Executing Custom SQL Expressions</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx" target="_blank">Part 9: Using a Custom LINQ Expression with the Control</a></li>
</ul>
</li>
</ul>
</li>
</ol>
</li>
<li>Another Place to Learn About LINQ is  <a href="http://linqinaction.net/blogs/default.aspx" target="_blank">LINQ in Action</a> . this site with its popularity has been written as a book  also for more information visit <a href="http://linqinaction.net/blogs/main/archive/2008/02/02/here-it-is-the-linq-in-action-paper-book.aspx" target="_blank">here</a>.</li>
<li>And now for WPF. here are the web sites which helped me to build my WPF knowledge.
<ol>
<li><a href="http://windowsclient.net/learn/videos_wpf.aspx" target="_blank">Windows Client official web site WPF Video Tutorials</a></li>
<li><a href="http://www.contentpresenter.com/" target="_blank">The Content Presenter</a></li>
<li><a href="http://thewpfblog.com/index.php" target="_blank">The WPF Blog</a></li>
</ol>
</li>
<li>And so far to lean <a href="http://www.silverlight.net" target="_blank">Silverlight</a> would recommend the official <a href="http://www.silverlight.net" target="_blank">Silverlight web site</a>.</li>
<li>and below are some more links which you might be interested in:
<ol>
<li><a href="http://blogs.msdn.com/pfxteam/default.aspx" target="_blank">Parallel Language Integrated Query (PLINQ)</a></li>
<li><a href="http://www.asp.net/learn/3.5-videos/" target="_blank">ASP.Net 3.5 Video Tutorials</a>.</li>
<li><a href="http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx" target="_blank">101 LINQ Samples</a>.</li>
<li>Xceed WPF Data Grid Component -<a href="http://xceed.com/Grid_WPF_New.html" target="_blank">Free full Version</a> (1 Developer Licence ).</li>
</ol>
</li>
<li>And finally <a href="http://www.microsoft.com/Downloads/details.aspx?familyid=8BDAA836-0BBA-4393-94DB-6C3C4A0C98A1&amp;displaylang=en" target="_blank">The Official Visual studio 2008 training kit by Microsoft</a></li>
</ol>
<p>Well These are the sites which I visit often to learn about these new technologies. I&#8217;m just sharing these with you to make it easy to find about these and  learn them easily without spending much time to search for these.</p>
<p>I hope it helped you, Enjoy!!.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2008/02/18/visual-studio-2008-c-30-linq-aspnet-35-getting-started/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Show Site Map Description on ASP.Net 2.0 Menu Control</title>
		<link>http://www.aneef.net/2008/02/13/show-site-map-description-on-aspnet-20-menu-control/</link>
		<comments>http://www.aneef.net/2008/02/13/show-site-map-description-on-aspnet-20-menu-control/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 06:23:41 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ASP.Net]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2008/02/13/show-site-map-description-on-aspnet-20-menu-control/</guid>
		<description><![CDATA[Recently one of my Friend Asked me, how do I display both the title and the description of the SiteMapNode in the ASP.Net menu control ? well unfortunately by default ASP.Net Menu doesn&#8217;t support this.because the menu binds directly to a MenuItem object. and the MenuItem does expose a DataItem Property,but when it is added [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Recently one of my Friend Asked me, how do I display both the title and the description of the <a href="http://msdn2.microsoft.com/en-us/library/7as0bse6.aspx" target="_blank">SiteMapNode</a> in the <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.aspx" target="_blank">ASP.Net menu control</a> ? well unfortunately by default ASP.Net Menu doesn&#8217;t support this.because the menu binds directly to a <a href="http://msdn2.microsoft.com/en-us/library/7as0bse6.aspx" target="_blank">MenuItem</a> object. and the MenuItem does expose a DataItem Property,but when it is added to the menu, it has no longer reference to the SiteMapNode which is used to populate it.</p>
<p>But we can write our own custom methods in your classes to Achieve this requirement, by looking at the SiteMapNode based on its title or URI. a sample is given below:</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">private</span> <span class="kwrd">string</span> menuDescription=<span class="kwrd">string</span>.Empty;</pre>
<pre><span class="lnum">   2:  </span>&nbsp;</pre>
<pre><span class="lnum">   3:  </span><span class="kwrd">protected</span> <span class="kwrd">string</span> GetDescriptionByTitle(<span class="kwrd">string</span> title)</pre>
<pre><span class="lnum">   4:  </span>{</pre>
<pre><span class="lnum">   5:  </span><span class="rem">/*this assumes that there is only one node with this title.</span></pre>
<pre><span class="lnum">   6:  </span><span class="rem">which is a standard in asp.net SiteMap Development*/</span></pre>
<pre><span class="lnum">   7:  </span>&nbsp;</pre>
<pre><span class="lnum">   8:  </span>SiteMapNode node = SiteMap.RootNode;</pre>
<pre><span class="lnum">   9:  </span>SearchForDesc(node, title);</pre>
<pre><span class="lnum">  10:  </span><span class="kwrd">return</span> menuDescription;</pre>
<pre><span class="lnum">  11:  </span>}</pre>
<pre><span class="lnum">  12:  </span>&nbsp;</pre>
<pre><span class="lnum">  13:  </span><span class="kwrd">private</span> <span class="kwrd">void</span> SearchForDesc(SiteMapNode node,<span class="kwrd">string</span> title)</pre>
<pre><span class="lnum">  14:  </span>{</pre>
<pre><span class="lnum">  15:  </span><span class="kwrd">if</span> (node.Title == title)</pre>
<pre><span class="lnum">  16:  </span>{</pre>
<pre><span class="lnum">  17:  </span>menuDescription = node.Description;</pre>
<pre><span class="lnum">  18:  </span><span class="kwrd">return</span>;</pre>
<pre><span class="lnum">  19:  </span>}</pre>
<pre><span class="lnum">  20:  </span><span class="kwrd">else</span></pre>
<pre><span class="lnum">  21:  </span>{</pre>
<pre><span class="lnum">  22:  </span><span class="kwrd">foreach</span> (SiteMapNode childnode <span class="kwrd">in</span> node.ChildNodes)</pre>
<pre><span class="lnum">  23:  </span>{</pre>
<pre><span class="lnum">  24:  </span><span class="rem">//search within childnodes</span></pre>
<pre><span class="lnum">  25:  </span>SearchForDesc(childnode, title);</pre>
<pre><span class="lnum">  26:  </span>}</pre>
<pre><span class="lnum">  27:  </span>}</pre>
<pre><span class="lnum">  28:  </span>}</pre>
</div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>&nbsp;</p>
<p>And we can use the <a href="http://msdn2.microsoft.com/en-us/library/5t12h3y4.aspx" target="_blank">StaticItemTemplate</a> and the <a href="http://msdn2.microsoft.com/en-us/library/2b7s9547.aspx" target="_blank">DynamicItemTemplate</a> to Display this information and use the <strong><em>GetDescriptionByTitle()</em></strong> method inside the templates as given below:</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">asp:Menu</span> <span class="attr">ID</span><span class="kwrd">="Menu1"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">Height</span><span class="kwrd">="24px"</span>
<span class="attr">Width</span><span class="kwrd">="109px"</span> <span class="attr">DataSourceID</span><span class="kwrd">="SiteMapDS1"</span> <span class="attr">StaticDisplayLevels</span><span class="kwrd">="2"</span>
<span class="attr">StaticSubMenuIndent</span><span class="kwrd">="0px"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">StaticItemTemplate</span><span class="kwrd">&gt;</span>    <span class="asp">&lt;%</span># Eval(<span class="str">"Text"</span>) <span class="asp">%&gt;</span> <span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;</span><span class="html">small</span><span class="kwrd">&gt;</span>
<span class="asp">&lt;%</span># GetDescriptionByTitle(((MenuItem)Container.DataItem).Text) <span class="asp">%&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">small</span><span class="kwrd">&gt;&lt;/</span><span class="html">StaticItemTemplate</span><span class="kwrd">&gt;&lt;</span><span class="html">DynamicItemTemplate</span><span class="kwrd">&gt;</span>
<span class="asp">&lt;%</span># Eval(<span class="str">"Text"</span>) <span class="asp">%&gt;</span> <span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>   <span class="kwrd">&lt;</span><span class="html">small</span><span class="kwrd">&gt;</span>
<span class="asp">&lt;%</span># GetDescriptionByTitle(((MenuItem)Container.DataItem).Text) <span class="asp">%&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">small</span><span class="kwrd">&gt;&lt;/</span><span class="html">DynamicItemTemplate</span><span class="kwrd">&gt;&lt;/</span><span class="html">asp:Menu</span><span class="kwrd">&gt;</span></pre>
<pre class="csharpcode"><span class="kwrd"></span>&nbsp;</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>And here is the output:</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="176" alt="menusample" src="http://www.aneef.net/wp-content/uploads/2008/02/menusample.jpg" width="244" border="0"></p>
<p>Hope it helps!.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2008/02/13/show-site-map-description-on-aspnet-20-menu-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.aneef.net @ 2012-02-04 23:08:20 by W3 Total Cache -->
