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

<channel>
	<title>blog.dervalp.com &#187; .NET</title>
	<atom:link href="http://blog.dervalp.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dervalp.com</link>
	<description>Think before Programming (Public learning)</description>
	<lastBuildDate>Sat, 20 Mar 2010 22:22:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>C#.NET &#8211; How to extend the .NET Framework easily (extension Methods)</title>
		<link>http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/</link>
		<comments>http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 18:02:50 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=342</guid>
		<description><![CDATA[For example, you want a method who validate if a string is an email or not.
You create a static class, StringExtensions for example, you put it public static and you add a method who take a string and verify if it is a mail or not.
Like this :
&#60;/pre&#62;
public static class StringExtensions
{
public static bool IsNotEmail (this [...]]]></description>
			<content:encoded><![CDATA[<p>For example, you want a method who validate if a string is an email or not.</p>
<p>You create a static class, StringExtensions for example, you put it public static and you add a method who take a string and verify if it is a mail or not.</p>
<p>Like this :</p>
<pre class="brush: c;">&lt;/pre&gt;
public static class StringExtensions
{
public static bool IsNotEmail (this string email)
{
var reg = new Regex(@&quot;^(([^&lt;&gt;()[\]\\.,;:\s@\&quot;&quot;]+&quot;

+ @&quot;(\.[^&lt;&gt;()[\]\\.,;:\s@\&quot;&quot;]+)*)|(\&quot;&quot;.+\&quot;&quot;))@&quot;

+ @&quot;((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}&quot;

+ @&quot;\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+&quot;

+ @&quot;[a-zA-Z]{2,}))$&quot;);
if(reg.IsMatch(email))
{
return true;
}

return false;

}

}
&lt;pre&gt;</pre>
<p>Now back to the class where you want to use this extension.</p>
<p>After a dot on a string variable, you will see it in the intellisense:</p>
<p><img class="alignnone size-full wp-image-344" title="intelisense_extension" src="http://blog.dervalp.com/wp-content/uploads/2009/06/intelisense_extension.png" alt="intelisense_extension" width="435" height="182" /></p>
<pre class="brush: c;">

string email = &quot;tralala@something.com&quot;;

if (email.IsEmail())

{
//do something

}
</pre>
<p>That&#8217;s awesome, is that not ?</p>
<p>Indeed, when you put the magic word &#8220;this&#8221; in a static method insided a static class, VS will browse all the methods who take a string object in argument and will add it to intellisense.</p>
<p>How do I use it ?</p>
<p>As soon as I see that I will need a simple method for a particular type very often, I extend this type and add it to a homemade library( which contains all the extension methods I create). Of course put in your library only the standard object of the .NET framework otherwise you will get some compilation errors.</p>
<p>You are now able to use all the power provided by the intellisense.</p>
<p>For example, you have a new developer in your team. He does not need to search in the project where the functions are. He simply put a dot after his variable and he will see what is available. Moreover, if he is new with the .NET Framework, he will believe that it is included by default <img src='http://blog.dervalp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>related link : <a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb383977.aspx</a></p>
<p>I expect my introduction to extension methods was clear, if not, do not hesitate to leave a comment&#8230;</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d342').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d342" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;title=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;title=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;title=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;title=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;title=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29+@+http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/&amp;t=C%23.NET+%26%238211%3B+How+to+extend+the+.NET+Framework+easily+%28extension+Methods%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d342').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d342').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/06/12/cnet-how-to-extend-the-net-framework-easily-extension-method/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>C#.NET Linq to Sql : System.Data.Linq.ChangeConflictException: Row not found or changed..</title>
		<link>http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/</link>
		<comments>http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/#comments</comments>
		<pubDate>Fri, 29 May 2009 16:18:53 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=278</guid>
		<description><![CDATA[I received this error during a get method (retreive the posts in my Kiwi Application).
I strangled with this during an hour and finally, I remembered that I had changed a NOT NULL field in my db to a allow null number.
So, when you do that, you simply have to update your Linq to Sql (dbml). [...]]]></description>
			<content:encoded><![CDATA[<p>I received this error during a get method (retreive the posts in my Kiwi Application).</p>
<p>I strangled with this during an hour and finally, I remembered that I had changed a NOT NULL field in my db to a allow null number.</p>
<p>So, when you do that, you simply have to update your Linq to Sql (dbml). Hope it helps.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d278').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d278" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;title=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;title=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;title=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;title=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;title=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed..+@+http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/&amp;t=C%23.NET+Linq+to+Sql+%3A+System.Data.Linq.ChangeConflictException%3A+Row+not+found+or+changed.." rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d278').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d278').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/29/cnet-linq-to-sql-systemdatalinqchangeconflictexception-row-not-found-or-changed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP.NET C#.NET cascade DropDownList using Ajax</title>
		<link>http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/</link>
		<comments>http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/#comments</comments>
		<pubDate>Mon, 25 May 2009 23:29:03 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=166</guid>
		<description><![CDATA[Using dropdownlist is, for me, a good thing, It allows you to avoid input error or make some coherent choice compared with a previous input.
The deal in this post, is to make a coherent cascade dropdownlist. For example, you choose a country and you would like to auto-populate the dropdownlist States. It is a common [...]]]></description>
			<content:encoded><![CDATA[<p>Using dropdownlist is, for me, a good thing, It allows you to avoid input error or make some coherent choice compared with a previous input.</p>
<p>The deal in this post, is to make a coherent cascade dropdownlist. For example, you choose a country and you would like to auto-populate the dropdownlist States. It is a common thing in web development. To do this in ASP.NET MVC, the Ajax Controller Toolkit does not work without modifying some code. It will take you more time to setup it than it takes to write the right code in a &#8220;pure&#8221; html way with Jquery.</p>
<h2><span id="more-166"></span></h2>
<p>1) Populate the dropdownlist &#8220;Countries&#8221; :</p>
<p>For example, add an action in the controller of your choice, retrieve your country from a db or whatever you want.</p>
<p>In my case, I retrieve the country list from a service who called a db but it is not the subject here.</p>
<p>You pass the data to the view by the ViewData object.</p>
<pre class="brush: c;">
public ActionResult Index()
{
var CountryList = new SelectList(_locationService.GetCountries(), &quot;CountryRegionCode&quot;, &quot;CountryRegionCode&quot;);

ViewData[&quot;Countries&quot;] = CountryList

return View(&quot;index&quot;);
}
</pre>
<p>2)Add the html objects</p>
<p>In you view index.aspx, you add a dropdown called &#8220;Countries&#8221; like you wrote in your controller. Like this, the view can know where he has to put the country list.</p>
<p>Add also the other dropdown,  a select object with an id = &#8220;States&#8221;.</p>
<pre class="brush: text;">
&lt;p&gt;
&lt;label for=&quot;Countries&quot; &gt;Country&lt;/label&gt;
&lt;%= Html.DropDownList(&quot;Countries&quot;, &quot;Select your Country&quot;)%&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;label for=&quot;StateProvinceCode&quot;&gt;State:&lt;/label&gt;
&lt;select name=&quot;States&quot; id=&quot;States&quot;&gt;
&lt;option value=&quot;&quot;&gt;Select your State&lt;/option&gt;
&lt;/select&gt;
&lt;/p&gt;
</pre>
<p>3) Add the javascript who will populate the dropdown &#8220;States&#8221;</p>
<p>If you launch your code now, you will see that the dropdrown called &#8220;countries&#8221; is well populated.</p>
<p>Nevertheless, the dropdown &#8220;States&#8221; is still empty. To fill in, I will use the ajax function from Jquery. It will call a function located in my controller. This action will receive the country region code and return the state list refined by the country region code (located in a db).</p>
<p>Here is the Javascript code to put inside the html head bracket.</p>
<pre class="brush: text;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(function() {
$(&quot;select#Countries&quot;).change(function() {
var countrycode = $(&quot;#Countries &gt; option:selected&quot;).attr(&quot;value&quot;);

$.ajax({
type: &quot;GET&quot;,
contentType: &quot;application/json; charset=utf-8&quot;,
url: &quot;/Location/States/&quot; + countrycode,
data: &quot;&quot;,
dataType: &quot;json&quot;,
success: function(data) {
if (data.length &gt; 0) {
var options = '';
for (s in data) {
var state = data[s];
options += &quot;&lt;option value='&quot; + state.Value + &quot;'&gt;&quot; + state.Text + &quot;&lt;/option&gt;&quot;;
}
$(&quot;#States&quot;).html(options);
}
}
});
});
});
</pre>
<p>The line of code bellow allow the script to know where there is a change on the dropdownlist &#8220;Countries&#8221;.</p>
<pre>$("select#Countries").change(function() {});</pre>
<p>When there is a change, we encapsulate the value.</p>
<pre>var countrycode = $("#Countries &gt; option:selected").attr("value");
</pre>
<p>We use this variable to pass through the URL.</p>
<pre>url: "/Location/States/" + countrycode</pre>
<p>After, the function collects the data, build the options of an html object.</p>
<pre>options += "&lt;option value='" + state.Value + "'&gt;" + state.Text + "&lt;/option&gt;";</pre>
<p>Finally we pass this list to the select object called &#8220;States&#8221;</p>
<pre>$("#States").html(options);</pre>
<p>4) Add the action method who will return the state list</p>
<p>If you launch that piece of code without adding the action &#8220;States&#8221; in you controller, you will receive a jscript error. So, add the action who will return the list of states you desire.</p>
<pre class="brush: c;">
public ActionResult States(string id)
{
var StateList = new SelectList(_locationService.GetStatesProvinces(id), &quot;StateProvinceCode&quot;, &quot;Name&quot;);
return Json(StateList);
}
</pre>
<p>This action will receive a string id (here the CountryRegionCode), called a function from my locationservice and retrieve the states by CountryRegionCode.</p>
<p>We only take the value that interests us by creating a selectedlist and then we call the function Json() which will serialize the data into a json format.</p>
<p>If you launch again your code and change the value of the dropdownlist &#8220;Countries&#8221;, the dropdownlist States will automatically be updated.</p>
<p>This is the end for this post and as usual, if you have questions or feedback, leave me a comment.</p>
<p>Related links :</p>
<p><a href="http://stephenwalther.com/blog/archive/2008/09/07/asp-net-mvc-tip-41-creating-cascading-dropdown-lists-with-ajax.aspx">http://stephenwalther.com/blog/archive/2008/09/07/asp-net-mvc-tip-41-creating-cascading-dropdown-lists-with-ajax.aspx</a></p>
<p><a href="http://www.michaeljbaird.com/post/2009/04/13/ASPnet-MVC-and-JQuery-Cascading-Droplist.aspx">http://www.michaeljbaird.com/post/2009/04/13/ASPnet-MVC-and-JQuery-Cascading-Droplist.aspx</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d166').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d166" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;title=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;title=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;title=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;title=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;title=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax+@+http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/&amp;t=ASP.NET+C%23.NET+cascade+DropDownList+using+Ajax" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d166').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d166').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/25/aspnet-cnet-cascade-dropdownlist-using-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C#.NET looping in Object properties</title>
		<link>http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/</link>
		<comments>http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/#comments</comments>
		<pubDate>Mon, 25 May 2009 13:48:32 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=163</guid>
		<description><![CDATA[
using System.Reflection; //the library to use

Code to put in your method :

Type type = objectforloop.GetType();

PropertyInfo[] properties = type.GetProperties();

foreach (PropertyInfo property in properties)
{
if (property.GetValue(objectforloop, null) != null)
{
Console.WriteLine(&#34;Name: &#34; + property.Name + &#34;, Value: &#34; + property.GetValue(objectforloop, null));
}
}



Bookmark It












Hide Sites



$$('div.d163').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); ]]></description>
			<content:encoded><![CDATA[<pre class="brush: c;">
using System.Reflection; //the library to use
</pre>
<p>Code to put in your method :</p>
<pre class="brush: c;">
Type type = objectforloop.GetType();

PropertyInfo[] properties = type.GetProperties();

foreach (PropertyInfo property in properties)
{
if (property.GetValue(objectforloop, null) != null)
{
Console.WriteLine(&quot;Name: &quot; + property.Name + &quot;, Value: &quot; + property.GetValue(objectforloop, null));
}
}
</pre>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d163').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d163" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;title=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;title=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;title=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;title=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;title=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+C%23.NET+looping+in+Object+properties+@+http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/&amp;t=C%23.NET+looping+in+Object+properties" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d163').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d163').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/25/cnet-looping-in-object-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C#.NET Create users in Active Directory</title>
		<link>http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/</link>
		<comments>http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/#comments</comments>
		<pubDate>Sat, 23 May 2009 02:26:16 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Adsiedit]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=122</guid>
		<description><![CDATA[I am currently working for a project in my job where I have to write an application which manage the active directory by a website application. I know that is not the best way to manage users in Active Directory but, well,&#8230;.
First, I decided to use the linq for Active Directory of Bart Desmet, I [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working for a project in my job where I have to write an application which manage the active directory by a website application. I know that is not the best way to manage users in Active Directory but, well,&#8230;.</p>
<p>First, I decided to use the linq for Active Directory of <a href="http://community.bartdesmet.net/blogs/bart/Default.aspx">Bart Desmet</a>, I know it&#8217;s a pre-alpha version but we do not have a lot of time and I really want to use all the facilities you have when you developed with linq. <a href="http://www.codeplex.com/LINQtoAD">Here is the link</a>. If you used linq to Active Directory, you should have saw that you do not have method to create. Therefore, I decided to use linq to AD for the &#8220;get&#8221; method and the &#8220;classic&#8221; method for creating users.</p>
<p>If you want to create a user in Active Directory, you should follow theses steps :</p>
<p>1) Create the user</p>
<p>2) Set the user&#8217;s password</p>
<p>3) Activate the user</p>
<h2><span id="more-122"></span>1) Create the user in active directory :</h2>
<p>I work with the respository pattern for all the data access.  So I created an ActiveDirectoryRepository where I put all the main &#8220;get&#8221; method and the create, update and delete method.</p>
<p>Here bellow, you can see my code. I create a CreateUser function in which I pass an object ActiveDirectoryUser (custom object).</p>
<p>First I set the directory entry where I want to add my user. It is quite like a connection string. With this link, the application know where he has to make his job.</p>
<p>After, I set all the properties to make a User with some basic information (name, firstname, city, country,&#8230;). When everything is set, I commit the change to active directory.</p>
<p>When it&#8217;s done, I call the ActivePassword function and the ActiveUser function. If everything goes well and if you have not received an exception error, your user in now created in the active directory and can login with the password you set during the creation. Here &#8220;newpassword&#8221;. Of course it is only to show a basic example <img src='http://blog.dervalp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><img class="alignnone size-full wp-image-126" title="create_user_ad_1" src="http://blog.dervalp.com/wp-content/uploads/2009/05/create_user_ad_1.png" alt="create_user_ad_1" width="801" height="585" /></p>
<p>Here under, the code for activate a user and set his password :</p>
<p><img class="alignnone size-full wp-image-127" title="create_user_ad_2" src="http://blog.dervalp.com/wp-content/uploads/2009/05/create_user_ad_2.png" alt="create_user_ad_2" width="806" height="452" /></p>
<p>Why 512 for the userAccountControl ? 512 is the value for a normal account in the active directory. I hardcoded it in the function but of course you can easily make some function to manage the type of user you want to create. To know more about the different possible type of user account, click <a href="http://support.microsoft.com/kb/305144">here</a>.</p>
<p>For example, if you want to have an active user with a password which expires never. You have to know the value for an active user, 512 and the value for the option &#8220;DONT_EXPIRE_PASSWORD&#8221; 65536. You add the number 512 and 65536. So, 66048 is the right number for the properties userAccountControl in this case.</p>
<p>NOTE : If you read my post about managing adam or azam account, I spoke about the support tools for Windows 2003. In these tools, there is one very usefull for developers to know where they have to put the data in. The snap in Adsiedit.msc. It shows you if the thing you are searching is a OU, a CN,&#8230; I will post more details about this tool in another post.</p>
<p>This is the end for today, if you have questions or comments, do not hesitate to leave a comment.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d122').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d122" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;title=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;title=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;title=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;title=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;title=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+C%23.NET+Create+users+in+Active+Directory+@+http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/&amp;t=C%23.NET+Create+users+in+Active+Directory" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d122').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d122').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/22/cnet-create-users-in-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to say to the compilator : &#8220;Leave me alone&#8221;</title>
		<link>http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/</link>
		<comments>http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:28:04 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=116</guid>
		<description><![CDATA[Simply, decorate your class or function with this code :
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "1000:YouShouldntBeCoding", MessageId = "1#",
Justification="Leave me allone annoying compilator!")]
You can find more info : here
I found that information in the Rob Conery&#8217;s blog.


Bookmark It












Hide Sites



$$('div.d116').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); ]]></description>
			<content:encoded><![CDATA[<p>Simply, decorate your class or function with this code :</p>
<pre class="csharpcode">[System.Diagnostics.CodeAnalysis.SuppressMessage(<span class="str">"Microsoft.Design"</span>, <span class="str">"1000:YouShouldntBeCoding"</span>, MessageId = <span class="str">"1#"</span>,
Justification=<span class="str">"Leave me allone annoying compilator!"</span>)]</pre>
<p>You can find more info : <a href="http://msdn.microsoft.com/en-us/library/aa288454(VS.71).aspx" target="_blank">here</a><br />
I found that information in the <a href="http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/" target="_blank">Rob Conery&#8217;s blog</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d116').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d116" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;title=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;title=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;title=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;title=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;title=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B+@+http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/&amp;t=How+to+say+to+the+compilator+%3A+%26%238220%3BLeave+me+alone%26%238221%3B" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d116').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d116').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/14/how-to-say-to-the-compilator-leave-me-alone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;AZAM, ADAM, Abracanabram&#8221; ! Is Harry Potter a dotnet developer?</title>
		<link>http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/</link>
		<comments>http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/#comments</comments>
		<pubDate>Tue, 12 May 2009 19:53:04 +0000</pubDate>
		<dc:creator>dervalp</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Active Directory MemberShip Provider]]></category>
		<category><![CDATA[ADAM]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[AZAM]]></category>
		<category><![CDATA[Membership Provider]]></category>

		<guid isPermaLink="false">http://blog.dervalp.com/?p=39</guid>
		<description><![CDATA[
Well, with all the acronyms which exist in the software development world, Harry Potter should have found a lot of words for his magic formulas. Today, I will explain you two of them, AZAM and ADAM.


The ASP.NET Membership Provider

 In my opinion, membership provider of ASP.NET provides a good abstraction for the authentication and the [...]]]></description>
			<content:encoded><![CDATA[<p><!--[endif]--></p>
<p class="MsoNormal"><span>Well, with all the acronyms which exist in the software development world, Harry Potter should have found a lot of words for his magic formulas. Today, I will explain you two of them, AZAM and ADAM.</span></p>
<h2 class="MsoNormal"><span><span id="more-39"></span><br />
</span></h2>
<h2 class="MsoNormal"><span>The ASP.NET Membership Provider<br />
</span></h2>
<p class="MsoNormal"><span> In my opinion</span><span>, <a href="http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx" target="_blank">membership provider of ASP.NET</a> provides a good abstraction for the authentication and the authorization. Moreover, I guess it is enough flexible that you can use it almost all the time. Thus, stop implementing your own custom authentication layer to make something that the framework does better than you and begin to learn it. </span></p>
<p class="MsoNormal"><span>Note : If you have cases where Membership provider cannot be use, please, share us your experience and leave a comment. </span></p>
<ul>
<li><span><a href="http://msdn.microsoft.com/en-us/library/system.web.security.sqlmembershipprovider.aspx" target="_blank">The SqlMembershipProvider</a> (absolutely needs a Sql Server database for working; Sql Express per default).</span></li>
<li><span><a href="http://msdn.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx" target="_blank">The ActiveDirectoryMembershipProvider</a>.</span></li>
</ul>
<p><span>Today, we will focus on ActiveDirectory Membership Provider; I will show you how to setup the ActiveDirectoryMembershipProvider, use Authorization Manager (Azman) as role provider and give you an introduction of Active Directory Application Mode (ADAM). Of course, to use ActiveDirectoryMembershipProvider, you need a domain controller (2003 SP2). It is not my aim to show you how to configure a DC, so I assume you have it up.</span></p>
<p><span><br />
If you only need an active directory authentication with no role managment, here is a post of my friend Mike who explains how to use Active Directory for the authentication with the new framework MVC (<a href="http://helios.ca/2009/05/04/aspnet-mvc-forms-authentication-with-active-directory/" target="_blank">http://helios.ca/2009/05/04/aspnet-mvc-forms-authentication-with-active-directory/</a>).</span></p>
<h2><span>Setting up Active Directory Membership Provider:</span></h2>
<h3><span>1. Add a ldap connection string to you Active Directory:</span></h3>
<p><span>Note : I assume you have the read permissions to your Active Directory.</span></p>
<p><span>If like me, you are sometimes a bit loss with active directory and the ldap protocol, here is a good tip to ensure a valid connection string. <a href="http://support.microsoft.com/kb/892777" target="_blank">Download the Windows Server 2003 Support tools: Windows Server 2003 Service Pack 1 Support Tools</a> and run the ADSIEDIT.MSC (per default in C:/ProgramFile/Support Tools). This tool allows you to see the structure of your Active Directory and it helps to make valid ldap connection string.</span></p>
<p><span>By default, you should see: DC = test, DC=mydomain, DC=COM. This is the first part of the connection string. Here is the first part of the connection string &#8220;test.mydomain.com&#8221;.<br />
After that, you should see objects as OU (organization unit) or CN (common name). If you expend the node DC=test, DC=mydomain. DC=COM, you will see all the OUs and the CNs of your active directory.  Normally, you should see the CN=Users or the OU User Accounts. When you have located where all your users are, you can now gathering the objects to make a valid LDAP connection string. </span></p>
<p><span>And here is the result: “LDAP://test.mydomain.com/CN=Users,DC=test,DC=mydomain,DC=com”.</span></p>
<p><span>So in you webconfig, you have to add this code :</span></p>
<p><span><img class="alignnone size-full wp-image-67" title="azam_adam1" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam1.jpg" alt="azam_adam1" width="658" height="90" /><br />
</span></p>
<h3><span>2. Configure the active directory membership provider :</span></h3>
<p><span>Now that you have a connection between your webserver and your domain controller, you will now be able to use AD for the authentication. To enable the active directory membership provider with you application, add some links to your webconfig file. </span></p>
<p><span>Find the &lt;membership&gt; element in your webconfig and add this:</span></p>
<p><span><img class="alignnone size-full wp-image-68" title="azam_adam2" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam2.jpg" alt="azam_adam2" width="658" height="179" /><br />
</span></p>
<p><span>More info here:<a href=" http://msdn.microsoft.com/en-us/library/whae3t94.aspx" target="_blank"> http://msdn.microsoft.com/en-us/library/whae3t94.aspx</a></span></p>
<h3><span>3. Wire Forms authentication with MemberShipProvider and your connection string :</span></h3>
<p><span>Add this code under the &lt;system.web&gt;</span></p>
<p><span><img class="alignnone size-full wp-image-70" title="azam_adam3" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam3.jpg" alt="azam_adam3" width="700" height="107" /><br />
</span></p>
<p><span>To use forms authentication, your IIS must use anonymous access enabled.</span></p>
<p><span>For IIS 6.0 :</span></p>
<ul>
<li><span>Command run : inetmgr</span></li>
<li>Right-click “properties” on your website</li>
<li><span>Directory Security</span><span>-Edit and you will receive this screen : Check that Anonymous access is enabled</span></li>
</ul>
<p><span><img class="alignnone size-full wp-image-72" title="azam_adam4" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam4.jpg" alt="azam_adam4" width="375" height="429" /><br />
</span></p>
<p><span>For IIS 7.0: <a href=" http://technet.microsoft.com/en-us/library/cc770966.aspx)" target="_blank">Here is the link</a>. </span></p>
<p><span>Note : To avoid storing a username and a password in a connection string, you can use IIS to manage that.  I hope I will have some time to write a post about that in the future.</span></p>
<h3><span>4. Taste it!</span></h3>
<p><span>Create a new MVC project and follow all the steps above, you should be now able to log you in with your active directory account.</span></p>
<p><span>Note : Here is the end of the first part, we saw the different methods to use ASP.NET Membership Provider and how to enable ActiveDirectory Membership provider. In next step, we will see how to use Authorization Manager and Active directory application mode.</span></p>
<h3><span>5. Active Directory Role manager :</span></h3>
<p><span>Now, that you have your authentication, you would expect an active directory role manager who retrieves the current user’s group information. Unfortunately, it does not exist. I saw interesting posts on the net <a href="(http://oricode.wordpress.com/2008/02/14/active-directory-role-provider/" target="_blank">(http://oricode.wordpress.com/2008/02/14/active-directory-role-provider/</a> and <a href="http://www.codeproject.com/KB/aspnet/active_directory_roles.aspx" target="_blank">http://www.codeproject.com/KB/aspnet/active_directory_roles.aspx</a> ) but I did not have the time to test it. It seems to sounds pretty good but if you search on MSDN, you will find that the &#8220;best practices&#8221; for Microsoft is using Azman.</span></p>
<h3>6. Authorization Manager:</h3>
<p>Azman or Authorization Manager “enables you to define individual operations, which can be grouped together to form tasks. You can then authorize roles to perform specific tasks and/or individual operations. AzMan provides an administration tool as a Microsoft Management Console (MMC) snap-in to manage roles, tasks, operations, and users. You can configure an AzMan policy store in an XML file, Active Directory, or in an Active Directory Application Mode (ADAM) store.” More info : <a href="http://msdn.microsoft.com/en-us/library/ms998336.aspx" target="_blank">here</a>.<br />
Here is a good “how to” from Msdn:<a href="http://msdn.microsoft.com/en-us/library/ms998336.aspx" target="_blank"> http://msdn.microsoft.com/en-us/library/ms998336.aspx</a><br />
Azman is installed with Windows Server 2003 SP1 and later. To use it with Windows XP, you need to install the Windows Server 2003 Administration Tools Pack (<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e487f885-f0c7-436a-a392-25793a25bad7&amp;DisplayLang=en" target="_blank">here</a>).<br />
Managing role membership with AzMan is quite easy; you can use the snap-in to add roles and tasks in your application. You can also easily map Windows accounts with the roles you have defined. It can be used with an XML file or ADAM.</p>
<h4 style="padding-left: 30px;">Install The AzMan Snapin, install it :</h4>
<p>First, Install the Windows Server 2003 Administration Tools Pack, which you can download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e487f885-f0c7-436a-a392-25793a25bad7&amp;DisplayLang=en" target="_blank">here</a>. <span>If you have some difficulties to have this screen, please follow the <a href="http://msdn.microsoft.com/en-us/library/ms998336.aspx" target="_blank">guideline </a>from MSDN. </span>In a run command type : &#8220;azman.msc&#8221;, you’ll receive this window :</p>
<p><img class="alignnone size-full wp-image-74" title="azam_adam5" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam5.jpg" alt="azam_adam5" width="628" height="440" /></p>
<h3 style="padding-left: 30px;">Developer Mode</h3>
<p>Right-Click “Authorization Manager”, “options”, choose “Developer Mode”.</p>
<h3 style="padding-left: 30px;">Create an Authorization Store</h3>
<p>Right Click “New Authorization Store” on “Authorization Manager”. Choose the XML file.</p>
<p><img class="alignnone size-full wp-image-75" title="azam_adam6" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam6.jpg" alt="azam_adam6" width="430" height="299" /></p>
<p>Browse the directory you want the Xml to be stored.  For example: &lt;PathOfYourApplicationFolder\App_Data\Roles.xml.<br />
As soon as you have created your “Role Manager”, you should now create an application.<br />
Right-Click on roles.xml, create New Application:</p>
<p><img class="alignnone size-full wp-image-76" title="azam_adam7" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam7.jpg" alt="azam_adam7" width="388" height="291" /></p>
<p>You have now a tree like this</p>
<p><img class="alignnone size-full wp-image-77" title="azam_adam8" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam8.jpg" alt="azam_adam8" width="180" height="163" /></p>
<p>-    Expand the Definitions folder and then right click on Role Definition&#8230;<br />
-    Provide a name for the role “Admin”<br />
-    Right Click on Role Assignments and select Assign Role Assignment, check the box against Admin and click OK. This role should now be listed under Role Assignments node.<br />
-    Right-click on the role Admin and you can assign Users form Windows or Active Directory.<br />
-    Choose assign to active directory and choose a user.</p>
<h3 style="padding-left: 30px;">Use your authorization store with your application :</h3>
<p>Open you web.config and add the connection string to your XML :</p>
<p><img class="alignnone size-full wp-image-78" title="azam_adam9" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam9.jpg" alt="azam_adam9" width="544" height="72" /></p>
<p>Enable Role Manager and configure the role provider :</p>
<p><img class="alignnone size-full wp-image-79" title="azam_adam10" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam10.jpg" alt="azam_adam10" width="566" height="111" /></p>
<h3 style="padding-left: 30px;">Configure Role with your web.config :</h3>
<p>Under &#8220;Secured&#8221;</p>
<p><img class="alignnone size-full wp-image-80" title="azam_adam11" src="http://blog.dervalp.com/wp-content/uploads/2009/05/azam_adam11.jpg" alt="azam_adam11" width="566" height="98" /></p>
<p>Test your website and it should works. Try to login with a user account which is not a member of the role you decided. You should not have access, try the opposite and you should have access.</p>
<p>Note: After you add a role in your application authorization store, you certainly have noticed that it needs some times to be effective. Indeed, you have to restart the application or wait for a recycle. I did not find any solution for the moment but there should be a way to force it. If you have a solution, please leave me a comment.</p>
<h2><strong>6. Active directory application mode (ADAM)</strong></h2>
<p>Instead of using an xml with AzMan, you could use ADAM. The main quality is that you can have one instance for all your web application in place of a XML file for each one.<br />
The “How to” in Msdn is so clear that I prefer to give you the link in place of explaining eveything step by step.</p>
<p>Here is the link: <a href="http://msdn.microsoft.com/en-us/library/ms998331.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms998331.aspx</a>. I tried it and I succeed to work with ADAM using AzMan policy.</p>
<p>Note:  ADAM is not supported on Windows Vista.<strong><br />
</strong></p>
<p><span>As always, if you have corrections or remarks, leave me a comment. Thank you.</span></p>
<p><span><br />
</span></p>
<p><span><br />
</span></p>
<p><span><br />
</span></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d39').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d39" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;title=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;title=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;title=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;title=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;title=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F+@+http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/&amp;t=%26%238220%3BAZAM%2C+ADAM%2C+Abracanabram%26%238221%3B+%21+Is+Harry+Potter+a+dotnet+developer%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://blog.dervalp.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d39').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d39').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://blog.dervalp.com/2009/05/12/azam-adam-abracanabram-%c2%bb-is-harry-potter-a-dotnet-developer-part-1-membershipprovider/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
