<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Huthaifa Afanah : ASP.NET</title><link>http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>In Hebron “Introduction to VS2008 &amp; ASP.NET” session</title><link>http://weblogs.asp.net/istofix/archive/2009/09/10/in-hebron-introduction-to-vs2008-amp-asp-net-session.aspx</link><pubDate>Thu, 10 Sep 2009 09:03:13 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7198958</guid><dc:creator>IsToFix</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=7198958</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2009/09/10/in-hebron-introduction-to-vs2008-amp-asp-net-session.aspx#comments</comments><description>As part of PalDev activities I was in Hebron this Saturday to deliver a “Introduction to VS2008 &amp;amp; ASP.NET” session for the PPU –Palestine Polytechnic University – CS and IT students. The workshop was held in Friends of Fawzi Kawash IT Center of Excellence...(&lt;a href="http://weblogs.asp.net/istofix/archive/2009/09/10/in-hebron-introduction-to-vs2008-amp-asp-net-session.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7198958" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/istofix/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://weblogs.asp.net/istofix/archive/tags/Sessions/default.aspx">Sessions</category><category domain="http://weblogs.asp.net/istofix/archive/tags/PalDev/default.aspx">PalDev</category></item><item><title>The Gu is Back!! with new Multilingual version!!</title><link>http://weblogs.asp.net/istofix/archive/2009/08/27/the-gu-is-back-with-new-multilingual-version.aspx</link><pubDate>Thu, 27 Aug 2009 07:58:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7182812</guid><dc:creator>IsToFix</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=7182812</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2009/08/27/the-gu-is-back-with-new-multilingual-version.aspx#comments</comments><description>Yesterday I checked my RSS feed and found that Scott Guthrie announced that he is starting a new series of posts . That was a great news to hear. Scott is one of the most popular Microsoft managers. He is one of those who played a core role developing...(&lt;a href="http://weblogs.asp.net/istofix/archive/2009/08/27/the-gu-is-back-with-new-multilingual-version.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7182812" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/istofix/archive/tags/Arabic+efforts/default.aspx">Arabic efforts</category><category domain="http://weblogs.asp.net/istofix/archive/tags/The+Gu_2100_/default.aspx">The Gu!</category></item><item><title>ASP.NET MVC 1.0 has been released</title><link>http://weblogs.asp.net/istofix/archive/2009/04/02/asp-net-mvc-1-0-has-been-released.aspx</link><pubDate>Thu, 02 Apr 2009 03:51:45 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7022119</guid><dc:creator>IsToFix</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=7022119</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2009/04/02/asp-net-mvc-1-0-has-been-released.aspx#comments</comments><description>Hello The Gu - Scott Guthrie - has announced the ASP.NET MVC 1.0. You can read the full post here. The amazing thing that ASP.NET MVC is an open source project and the code released under MS-PL licenses. And they say Microsoft does not support open source...(&lt;a href="http://weblogs.asp.net/istofix/archive/2009/04/02/asp-net-mvc-1-0-has-been-released.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7022119" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>ASP.NET site crashed today!!</title><link>http://weblogs.asp.net/istofix/archive/2008/10/26/asp-net-site-crashed-today.aspx</link><pubDate>Sun, 26 Oct 2008 09:01:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6704590</guid><dc:creator>IsToFix</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=6704590</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2008/10/26/asp-net-site-crashed-today.aspx#comments</comments><description>
&lt;p&gt;Today while I am navigating through the Internet I visited the&lt;a href="http://weblogs.asp.net" mce_href="http://weblogs.asp.net"&gt; http://weblogs.asp.net&lt;/a&gt; as usual. Then I moved to the asp.net site and surprise the ASP.Net site seems to have some problems. This problem seems to be solved very fast but I catch it. Notice the date and time below the image&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/aspCrash.JPG"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/aspCrash.JPG" title="ASP.NET site crashed" alt="ASP.NET site crashed" mce_src="http://weblogs.asp.net/blogs/istofix/aspCrash.JPG" width="720" border="0" height="450"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;Anyway it's not matter, but I make this post to ensure that even the most reliable and well managed web applications and websites may face problems some times.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
Have a nice day
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6704590" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/istofix/archive/tags/errors/default.aspx">errors</category></item><item><title>Embedded Resources difference between VB.NET and C# projects</title><link>http://weblogs.asp.net/istofix/archive/2008/10/21/embedded-resources-in-vb-net-and-c-projects.aspx</link><pubDate>Tue, 21 Oct 2008 13:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6696369</guid><dc:creator>IsToFix</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=6696369</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2008/10/21/embedded-resources-in-vb-net-and-c-projects.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;While I am developing a custom web control to extend the default validation summary I used some images within this control. One of the nice features and solutions came with ASP.NET 2.0 to address this problem is using web resources. So I embedded these images in my custom control assembly and used the &lt;span style="color: rgb(43, 145, 175);"&gt;Page&lt;/span&gt;&lt;span style="color: black;"&gt;.ClientScript.GetWebResourceUrl&lt;/span&gt; to resolve their URL's.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;To do this task correctly you need to do 2 simple steps:
&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-left: 39pt;"&gt;&lt;li&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;First, you need to select whatever file you want to embed in your assembly and then set the &lt;b&gt;Build Action&lt;/b&gt; property from its properties to &lt;b&gt;Embed &lt;/b&gt;this is straight forward as saying 1, 2, 3. &lt;br&gt;&lt;a href="http://weblogs.asp.net/controlpanel/blogs/C:%5CDocuments%20and%20Settings%5CAdmin%5CApplication%20Data%5CWindows%20Live%20Writer%5CPostSupportingFiles%5C27ab55f0-7cc0-4f0c-b7d1-ce3b86109466%5CembedFile4.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes1.jpg" mce_src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes1.jpg" alt="" border="0"&gt;&lt;/a&gt;
			&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;The second this we need to do is referencing that embedded resource so it could be retrieved as a web resources.This could be accomplished by adding WebResource attributes in&amp;nbsp;the Assembly.info file. 
&lt;/span&gt;&lt;/div&gt;&lt;p style="text-align: center;"&gt;&lt;a href="http://weblogs.asp.net/controlpanel/blogs/C:%5CDocuments%20and%20Settings%5CAdmin%5CApplication%20Data%5CWindows%20Live%20Writer%5CPostSupportingFiles%5C27ab55f0-7cc0-4f0c-b7d1-ce3b86109466%5CassemblyInfo7.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes2.jpg" mce_src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes2.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;
				&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;br&gt;In general to do this all we need is to add the web resource attribute like 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;span style="color: black;"&gt;&amp;lt;Assembly:&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;System.Web.UI.WebResource(&lt;/span&gt;&lt;span style="color: gray;"&gt;"EmbeddedResourcesVB.Sunset.jpg"&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: gray;"&gt; "image/jpg"&lt;/span&gt;&lt;span style="color: black;"&gt;)&amp;gt;&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt; the WebResource takes two parameters, the &lt;i&gt;first one&lt;/i&gt; is the resource full name which following this convention: &lt;b&gt;(Rootnamespace).(SubNameSapce).(Filename).(Extension) &lt;/b&gt;and the &lt;i&gt;second parameter&lt;/i&gt; is the MIEM file type of the resource 
&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 13pt;"&gt;So what's wrong?
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;This looks very simple but why all problems occurred? What is the error prone thing which make all these posts and articles on the web!! To identify this we can say there is some issue regarding the way that VB.NET projects and C# projects being organized. Is that true? Yes that's true!! 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblogs.asp.net/controlpanel/blogs/C:%5CDocuments%20and%20Settings%5CAdmin%5CApplication%20Data%5CWindows%20Live%20Writer%5CPostSupportingFiles%5C27ab55f0-7cc0-4f0c-b7d1-ce3b86109466%5CSolution5.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes3.jpg" mce_src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes3.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;To figure out this issue I created simple solution conations a VB.NET project and a C# project. and add an image to each of them as our embedded resource. I changed the &lt;b&gt;Root Namespace&lt;/b&gt; property for each project to make it clear that the assembly name has nothing to do with WebResource name. By default the &lt;b&gt;Root Namespace == assembly name &lt;/b&gt;but in some certain scenarios you need to change that so by choosing the project properties you can change the assembly name property and the RootNamespace property.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;After building our solution let's have a closer look to the embedded resources after being compiled into assembly. So let's open EmbResVB.dll and EmbResCSharp.dll using Reflector. If you take a quick look to the image below you can note that the &lt;i&gt;Sunset.jpg&lt;/i&gt; image resource name differs from the Vb.Net assembly to the C# one.
&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&lt;a href="http://weblogs.asp.net/controlpanel/blogs/C:%5CDocuments%20and%20Settings%5CAdmin%5CApplication%20Data%5CWindows%20Live%20Writer%5CPostSupportingFiles%5C27ab55f0-7cc0-4f0c-b7d1-ce3b86109466%5Crefelector6.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes4.jpg" mce_src="http://weblogs.asp.net/blogs/istofix/102108_1300_EmbeddedRes4.jpg" alt="" border="0"&gt;&lt;/a&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: center;"&gt;&amp;nbsp;
&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;But we said that the resource name should follow this convention: &lt;b&gt;(RootNameSpace).(SubNameSapce).(Filename).(Extension) &lt;/b&gt;so what's happens??!! &lt;br&gt;&lt;b&gt;Here's what happen:&lt;/b&gt; in the C# projects if you add a new class to your solution you will find that the IDE put's this file in a namespace regarding to the solution folders hierarchy. But in VB.NET projects this is not occur. Let's take the ImagesUrl class as example, this class which exists's under the images folder in our testing C# and VB.NET projects but it will look like this by default in C#:
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;System&lt;/span&gt;&lt;span style="color: blue;"&gt;;&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;System.Collections.Generic&lt;/span&gt;&lt;span style="color: blue;"&gt;;&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;System.Text&lt;/span&gt;&lt;span style="color: blue;"&gt;;&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;EmbeddedResourcesCSharp.Images&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;ImagesURL&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;{&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;span style="color: gray;"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;while in the VB.NET project it will be added to the root namespace by default:
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;Public&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;Class&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;ImagesUrl&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;New&lt;/span&gt;&lt;span style="color: black;"&gt;()&lt;/span&gt;&lt;span style="color: gray;"&gt;
			&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/asp.net" mce_href="http://technorati.com/tags/asp.net"&gt;&lt;span style="color: rgb(102, 153, 102); text-decoration: underline;"&gt;asp.net&lt;/span&gt;&lt;/a&gt;,&lt;a href="http://technorati.com/tags/embbede%20resources" mce_href="http://technorati.com/tags/embbede%20resources"&gt;&lt;span style="color: rgb(102, 153, 102); text-decoration: underline;"&gt;embbede resources&lt;/span&gt;&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.Net" mce_href="http://technorati.com/tags/.Net"&gt;&lt;span style="color: rgb(102, 153, 102); text-decoration: underline;"&gt;.Net&lt;/span&gt;&lt;/a&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&lt;span style="color: gray;"&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;span style="color: gray;"&gt;
				&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;Class&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;C# is doing this because of the VC# wizards which work in the background when you add new items to your project. Here's an article for one of the VS team descriping this issue &lt;a href="http://blogs.msdn.com/joen/archive/2004/03/15/90002.aspx" mce_href="http://blogs.msdn.com/joen/archive/2004/03/15/90002.aspx" title="http://blogs.msdn.com/joen/archive/2004/03/15/90002.aspx"&gt;&lt;span style="color: rgb(102, 153, 102); text-decoration: underline;"&gt;http://blogs.msdn.com/joen/archive/2004/03/15/90002.aspx&lt;/span&gt;&lt;/a&gt;. 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;Anyway it seems that C# IDE is handling the other files like our image in the same way. So our &lt;b&gt;Sunset.jpg&lt;/b&gt; image have been listed under the images namespace which actually it's parent folder name. But in the VB.NET project &lt;b&gt;Sunset.jpg &lt;/b&gt;is being added to the root namespace never mind in any sub folder it exists.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;Ok, that's it, the reason of all the misunderstanding. Many VB.NET developers reading posts or articles about embedded resources written in C# and they didn't notice the different in embedded resources names between the VB.NET and C# projects. 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 13pt;"&gt;The result
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;In a C# project embedded resources names follows this convention &lt;b&gt;(RootNampeSpace).(Path).(FileName).(Extension)&lt;/b&gt; where Path is the folders path in which this resource exist &lt;b&gt;&lt;i&gt;Root/Folder/SubFolder/.../ResourceFile&lt;/i&gt;&lt;/b&gt; .In A VB.NET project embedded resources names follows this convention &lt;b&gt;(RootNampeSpace).(FileName).(Extension) &lt;/b&gt;and the resource path does not affect its name.
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;Hope that help. Happy asp.net
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;Huthaifa
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Trebuchet MS; font-size: 10pt;"&gt;&amp;nbsp;
&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6696369" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/istofix/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/istofix/archive/tags/embedded+resources/default.aspx">embedded resources</category><category domain="http://weblogs.asp.net/istofix/archive/tags/C_2300_/default.aspx">C#</category></item><item><title>Implementing observer pattern</title><link>http://weblogs.asp.net/istofix/archive/2008/01/31/implementing-observer-pattern.aspx</link><pubDate>Thu, 31 Jan 2008 15:06:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5682284</guid><dc:creator>IsToFix</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/istofix/rsscomments.aspx?PostID=5682284</wfw:commentRss><comments>http://weblogs.asp.net/istofix/archive/2008/01/31/implementing-observer-pattern.aspx#comments</comments><description>&lt;h3&gt;Introduction:&lt;/h3&gt;  &lt;p&gt;While I was developing a new web application in our company I found that every entity in the system has some shared fields which holds data about when and who saved this entity into the system. Basically those fields were CreationDate, CreatedBy, LastModificationDate, LastModificationBy and EntityId for sure. &lt;/p&gt;  &lt;p&gt;There are multiple approaches to solve this situation:&lt;/p&gt;  &lt;p&gt;1. In every user control include these fields and reflect data to them directly: but this will force you to write more duplicated code. And this will make update and maintenance more complicated and error frequent process. Imagine that you have 10 controls this means you need to do 10 updates if any update is needed in the entity details.&lt;/p&gt;  &lt;p&gt;2. Create a user control called details and place those fields in it and access those fields directly from each entity screen: although this will ease maintenance and updates this approach has a disadvantage which that those controls are now tightly coupled. &lt;/p&gt;  &lt;p&gt;Applications with tightly coupled classes tend to be brittle and difficult to maintain, because changes in one class could affect all the tightly coupled classes.&lt;/p&gt;  &lt;p&gt;The problem: How can user controls -objects- notify other controls –objects- of state changes without being dependent on their classes?&lt;/p&gt;  &lt;p&gt;3. Using observer pattern and create loosely coupled controls to communicate between each other without depending in their classes.&lt;/p&gt;  &lt;p&gt;In this article I will show how to a build simple user control that implements observer pattern to handle updates and passing notifications around to update a set of objects when some important event has occurred.&lt;/p&gt;  &lt;h3&gt;Background:&lt;/h3&gt;  &lt;p&gt;The observer pattern is categorized under &lt;b&gt;Behavioral Patterns&lt;/b&gt;. Behavioral Patterns is those patterns are concerned with algorithms and the assignment of responsibilities between objects. Behavioral patterns describe not just patterns of objects or classes but also the patterns of communication between them.&lt;/p&gt;  &lt;h5&gt;So what is observer pattern?&lt;/h5&gt;  &lt;p&gt;Observer design pattern should “Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.”&lt;/p&gt;  &lt;h5&gt;What is Subject? What is observer?&lt;/h5&gt;  &lt;p&gt;Subject: is the object which wills frequently changes his state from time to time. And there is another objects depends on it.&lt;/p&gt;  &lt;p&gt;Observer: is the object which depends on a subject keep eye on updates at his subject state.&lt;/p&gt;  &lt;h5&gt;Here’s how it works:&lt;/h5&gt;  &lt;p&gt;An observer signs up to receive notifications of changes to the subject.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image002_2.jpg" mce_href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image002_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image002_thumb.jpg" style="border: 0px none ;" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image002_thumb.jpg" border="0" height="116" width="325"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A second observer can register itself too. In fact a subject may have any number of dependent observers. Observers are not aware of presence of each other. &lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image004_2.jpg" mce_href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image004_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image004_thumb.jpg" style="border: 0px none ;" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image004_thumb.jpg" border="0" height="115" width="325"&gt;&lt;/a&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;When certain event occurred all observers are notified.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image006_2.jpg" mce_href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image006_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image006_thumb.jpg" style="border: 0px none ;" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image006_thumb.jpg" border="0" height="86" width="325"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;An observer can unregister itself from subject so he will never receive notifications from subject. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image008_2.jpg" mce_href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image008_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image008_thumb.jpg" style="border: 0px none ;" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image008_thumb.jpg" border="0" height="115" width="325"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;With this generic way of communicating between the subject and observers, collaborations can be built dynamically instead of statically. The code is now much more separate, and thus easier to maintain and reuse. There is no direct dependency between subject class and observer class.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image010_2.jpg" mce_href="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image010_2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image010_thumb.jpg" style="border: 0px none ;" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/istofix/WindowsLiveWriter/Implementingobserverpattern_F023/clip_image010_thumb.jpg" border="0" height="184" width="229"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In our example Address_UC is a &lt;b&gt;ConcreteSubject&lt;/b&gt; and RecordDetails_UC is one of it &lt;b&gt;ConcreteObservers&lt;/b&gt;, so when the domain object associated with Address_UC class has changed the RecordDetails_UC class will be notified and handles this event in a proper way. I will show how explicitly implement observer pattern and another time by using delegates and events.&lt;/p&gt;  &lt;h5&gt;Implementing Subject class:&lt;/h5&gt;  &lt;p&gt;You can implement Subject class as super class or abstract class. But due the limitation in some languages like C#,VB.Net that class can inherits only one. This will cause a problem because most of domain objects are inherits from domain objects. So our subject class will be implemented using interface. Remember that class can implement many interfaces.&lt;/p&gt;  &lt;pre&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;interface&lt;/span&gt; ISubject &lt;br&gt;{ &lt;br&gt;List&amp;lt;IObserver&amp;gt; ObserversList {&lt;span style="color: rgb(0, 0, 255);"&gt;get&lt;/span&gt;;} &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; AttachObserver(IObserver observer); &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; DeAttachObserver(IObserver observer); &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; NotifyObservers(); &lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;Basically our Subject interface contains methods to attach, deattach and notify observers. And each&lt;b&gt; ConcreteSubject&lt;/b&gt; class – means class that implement the subject interface - should define a list of &lt;b&gt;ConcreteObservers&lt;/b&gt;.&lt;/p&gt;

&lt;h5&gt;Implementing observer class:&lt;/h5&gt;

&lt;pre&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;interface&lt;/span&gt; IObserver&lt;br&gt;&lt;br&gt;{&lt;br&gt;&lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; Updateobject(ISubject subject);&lt;br&gt;&lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;The observer class is very simple and contains a method that allowed subjects to notify it.&lt;/p&gt;

&lt;p&gt;All we need know is to implement ISubject methods in our &lt;b&gt;ConcreteSubject “Address_UC” &lt;/b&gt;as simple as this:&lt;/p&gt;

&lt;pre&gt;#region ISubject Members &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; List&amp;lt;ObserverTutorial.App_Code.IObserver&amp;gt; ObserversList &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;get&lt;/span&gt; { &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.m_ObserversList; } &lt;br&gt;} &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; AttachObserver(ObserverTutorial.App_Code.IObserver observer) &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.ObserversList.Add(observer); &lt;br&gt;} &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; DeAttachObserver(ObserverTutorial.App_Code.IObserver observer) &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.ObserversList.Remove(observer); &lt;br&gt;} &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; NotifyObservers() &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt; (App_Code.IObserver observer &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.ObserversList ) &lt;br&gt;{ &lt;br&gt;observer.Updateobject(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;); &lt;br&gt;} &lt;br&gt;} &lt;br&gt;#endregion&lt;/pre&gt;

&lt;p&gt;Note that NotifyObservers method will be called form another method in the &lt;b&gt;Address_UC &lt;/b&gt;when an certain event occur something like after user save domain object data:&lt;/p&gt;

&lt;pre&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; btnOk_Click(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, EventArgs e) &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt; result = SaveEntityData(); &lt;br&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;/// After Subject object data is saved in a state notify observers &lt;/span&gt;&lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (result) &lt;br&gt;{ &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.NotifyObservers(); &lt;br&gt;} &lt;br&gt;}&lt;/pre&gt;

&lt;p&gt;In the &lt;b&gt;ConcreteObserver “RecordDetails_UC”&lt;/b&gt; the implementation of the IObserver lonely method Updateobject allow &lt;b&gt;Address_UC &lt;/b&gt;to notify&lt;b&gt; RecordDetails_UC &lt;/b&gt;that it has changed and passing itself as parameter so&lt;b&gt; RecordDetails_&lt;/b&gt;UC can update his state too in a proper way. But firstly &lt;b&gt;RecordDetails_UC &lt;/b&gt;needs to register itself with &lt;b&gt;Address_UC:&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;ISubject Subject = &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.Parent &lt;span style="color: rgb(0, 0, 255);"&gt;as&lt;/span&gt; ISubject; &lt;br&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Subject != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;) &lt;br&gt;{ &lt;br&gt;Subject.AttachObserver(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;); &lt;br&gt;}&lt;/pre&gt;

&lt;h5&gt;Are we smarter than Microsoft so they does not have observer pattern implemented yet?&lt;/h5&gt;

&lt;p&gt;Microsoft .NET Framework defines the notion of delegates and events to accomplish the &lt;i&gt;Observer&lt;/i&gt; role. Therefore, you would rarely implement the &lt;i&gt;Observer&lt;/i&gt; pattern explicitly in .NET, but should use delegates and events instead. I attached implementation of this sample using delegates and events too.&lt;/p&gt;&lt;p&gt;You can download the tutorial file from the attachments here ...&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5682284" width="1" height="1"&gt;</description><enclosure url="http://weblogs.asp.net/istofix/attachment/5682284.ashx" length="50502" type="application/x-zip-compressed" /><category domain="http://weblogs.asp.net/istofix/archive/tags/Patterns/default.aspx">Patterns</category><category domain="http://weblogs.asp.net/istofix/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>