<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Emad Ibrahim</title>
	
	<link>http://www.emadibrahim.com</link>
	<description>web development, tech reviews, tips, tricks, blogging</description>
	<lastBuildDate>Wed, 13 May 2009 15:27:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/EmadIbrahim" type="application/rss+xml" /><feedburner:emailServiceId>EmadIbrahim</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Startup – How To Build A Web 2.0 Business: The Risks</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/-nVkjoKrdjg/</link>
		<comments>http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/#comments</comments>
		<pubDate>Sun, 10 May 2009 02:29:39 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Startup]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[series]]></category>
		<category><![CDATA[web20]]></category>
		<category><![CDATA[Yonkly]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/?p=617</guid>
		<description>If you have been reading along, I probably sound like a broken record, talking about how I quit my job over a year ago and decided to go solo (here and here).  It has been a tough but fun ride so far and I have made a few mistakes and learned a lot on the [...]</description>
			<content:encoded><![CDATA[<p>If you have been reading along, I probably sound like a broken record, talking about how I quit my job over a year ago and decided to go solo (<a href="http://www.emadibrahim.com/2008/03/20/i-quit/">here</a> and <a href="http://www.emadibrahim.com/2009/03/09/i-quit-1-year-anniversary/">here</a>).  It has been a tough but fun ride so far and I have made a few mistakes and learned a lot on the way.  I would like to share some of these experiences with you, so hopefully you won’t make the same mistakes.  I say that even though I know that you will still make them, but at least I warned you.</p>
<p>Initially, I thought I should turn this into an eBook and sell it for a few bucks then I thought my target audience are probably not willing to spend money even it were only 5 bucks.  I finally settled on making it into a series of blog posts and also incorporating your comments along the way.</p>
<h2>Risks</h2>
<p>First, let’s set the stage.  My situation is probably different than yours; so if you have lots of money saved up, rich parents or potential investors and have no debt then some of these questions/pointers might not apply to you.  I started off with <strong>zero savings</strong>, high <strong>credit card debt</strong> and pretty good credit score.  So, among money of the risks you will be taking, ask yourself <span style="text-decoration: underline;">if you are willing to end up with bad credit</span>.  A year+ later, I am short selling my condo, have a lot <strong>more debt</strong> than before and I don’t even want to know my credit score.</p>
<p>I was telling my sister about my situation and she said “you are taking this surprisingly well.  You used to be very conscious of your credit score”.  Well, I told her it’s<strong> not the end of the world</strong> and I will just have to learn to <strong>live within my means</strong> for the next few years until banks agree to lend me again.  Can you imagine living in a world where you only buy the car you can afford?  The computer you can afford?  The house you can afford?  So again, are you willing to take this risk and take it “<strong>surprisingly well</strong>” if things go bad?</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2009/05/willcodeforfoodgeekhappenscartoonsba1.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Will code for food - GEEK HAPPENS CARTOONS BANDES DESSINES FUMETTI COMICS FUN" src="http://www.emadibrahim.com/wp-content/uploads/2009/05/willcodeforfoodgeekhappenscartoonsba1-thumb.jpg" border="0" alt="Will code for food - GEEK HAPPENS CARTOONS BANDES DESSINES FUMETTI COMICS FUN" width="512" height="512" /></a></p>
<p>So far we have “Are you willing to end up with bad credit?”, this of course is one of many more questions you should ask yourself to assess your readiness to take the leap:</p>
<ul>
<li>Can you handle a foreclosure?</li>
<li>Can you live without a car if it breaks down and you can’t fix it or if it gets repossessed?</li>
<li>Can your significant other handle it?</li>
<li>Can you handle living without some “relative luxuries”: eating out, drinking, partying, vacation, gadgets, toys and so on?</li>
</ul>
<p>In the above questions, when I say “handle”, I mean “can you mentally, psychologically and physically handle it?”.  It is really hard for me to walk into Best Buy or stumble on <a href="http://www.amazon.com/exec/obidos/redirect-home/dotnetfactory-20" target="_blank">Amazon.com</a> and come out empty handed.  It is very difficult for me to go out with some friends and just order a couple of beers all night.  All I am saying is: <strong>prepare yourself</strong>.</p>
<p>One more thing and then I will move on.  A friend once told me about how brave I was for doing this and that he could never do the same thing in a million years.  I asked him what was his biggest fear and his answer shocked me: “… that my wife would leave me”.  I am sorry, but personally I think if you are thinking this way then you probably married the wrong person.  And, honestly if she leaves you because you are broke, then good riddance.  What happens to “until death do us apart”, it’s not “until your credit score do us apart”.  Luckily, my fiancé is still around and we are getting married in the next few months.  Off topic: weddings are a big, expensive, waste-of-money one-night party that no one will remember.  And if anyone remembers your wedding 3 months later it is because it was really good or really bad.</p>
<h2>Offsets</h2>
<p>There are many things to offset the risk while you are starting your company.  The most obvious one is to not quit your job.  I personally couldn’t do that.  You can’t spend 10 hours at work and then come back home and be able to fully focus and commit to your startup.  If you can do that then you should.  But say goodbye to your social life and probably health and mental well being.</p>
<p>Again there are a hundred ways to offset the risk and generate some money on the side if not to cover all your bills at least it will cover your food and Internet bill.  I don’t know you and I don’t know what you can do to make some money but I will tell you some of the things I did and an estimate on how income they generated.</p>
<ul>
<li>Consulting gigs (web development and social media consulting) &#8211; $30k</li>
<li>Online ad Revenue from my <a href="http://emadibrahim.com/projects" target="_blank">websites</a> &#8211; $2k</li>
<li>Startup/<a href="http://yonkly.com" target="_blank">yonkly</a> – revenue (I know!  Can you believe that?  It is already generating revenue) &#8211; ~$10k.  Most of the money was a side effect of the startup e.g. custom development.</li>
<li><a href="http://bit.ly/H7ziD" target="_blank">Book writing</a> – I don’t think I am allowed to disclose the amount but let’s just say it’s enough money to pay your bills for 2 or 3 months.</li>
<li><a href="http://tinyurl.com/584khw" target="_blank">Article writing</a> – depends on the magazine but should be between $500 and $1000 per article.</li>
<li>Sell your junk on amazon, ebay and craigslist.  I sold a ton of books, dvds and electronics that I didn’t use anymore &#8211; $1k.  It won’t make you reach but it will be enough money to feed the dog for a few months.</li>
<li>Raise money &#8211; $0.  Hey, don’t sound surprised, it’s a tough market.</li>
<li>Not selling your organs on the black market – priceless.</li>
</ul>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2009/05/img-6893.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="IMG_6893" src="http://www.emadibrahim.com/wp-content/uploads/2009/05/img-6893-thumb.jpg" border="0" alt="IMG_6893" width="483" height="366" /></a></p>
<p>The important thing is that you need to find the <strong>right balance</strong>.  If you do too much consulting then you won’t have time for your startup.  But if you get lucky and find a contract that lasts a couple of months and pays a lot of money then take it.  That should keep you going for a few more months.</p>
<h2>Coming Up</h2>
<p>I don’t want to make this post too long.  I talked about the risks and how to offset.  It is important to understand that you are <strong>minimizing risk</strong> – not eliminating it.</p>
<p>I am going to focus this series on an web startup or do I dare say a web 2.0 startup.  Not everything will apply to everyone (or to anyone for that matter) but hopefully it will be helpful and entertaining.  I would like to cover the following topics in future posts:</p>
<ul>
<li>Building The Website (multiple posts)
<ul>
<li>Development (Programming)</li>
<li>Hosting and scaling</li>
<li>Payment integration (PayPal)</li>
</ul>
</li>
<li>Marketing &amp; PR (here is a good <a href="http://bit.ly/30txp" target="_blank">book</a>)</li>
<li>Tools &amp; Services (I will expand on my <a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" target="_blank">previous post</a>)</li>
<li>Resources &amp; References</li>
<li>[insert your suggestion here]</li>
</ul>
<p>Help me expand the previous list.  Leave a comment and tell me what you would like me to discuss.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/30/my-elevator-pitch/" rel="bookmark" title="Permanent Link: My Elevator Pitch" >My Elevator Pitch</a></span><div class="aizattos_related_posts_excerpt">I found this cool site that has a free wizard which helps you build your elevator (15 second) pitch....</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/25/web-design-toolbox/" rel="bookmark" title="Permanent Link: Web Design Toolbox" >Web Design Toolbox</a></span><div class="aizattos_related_posts_excerpt">Here is an excellent post with tons of links to all sort of web design sites, tools, resources, etc....</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" rel="bookmark" title="Permanent Link: Services Worth Paying For as a Startup" >Services Worth Paying For as a Startup</a></span><div class="aizattos_related_posts_excerpt">[Update: added crowdsound] If you have been reading my blog or following me on Twitter then you alre...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/06/27/free-it-consultation-in-the-dc-metro-area/" rel="bookmark" title="Permanent Link: Free IT Consultation in the DC Metro Area" >Free IT Consultation in the DC Metro Area</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/09/startup-next-steps/" rel="bookmark" title="Permanent Link: Startup: Next Steps" >Startup: Next Steps</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/yQmPHNuJ4Dx709ahq6QiH7NgOMg/0/da"><img src="http://feedads.g.doubleclick.net/~a/yQmPHNuJ4Dx709ahq6QiH7NgOMg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/yQmPHNuJ4Dx709ahq6QiH7NgOMg/1/da"><img src="http://feedads.g.doubleclick.net/~a/yQmPHNuJ4Dx709ahq6QiH7NgOMg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/-nVkjoKrdjg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/</feedburner:origLink></item>
		<item>
		<title>Shortening URLs with bit.ly’s API in .NET</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/qSzaLyrwOvs/</link>
		<comments>http://www.emadibrahim.com/2009/05/07/shortening-urls-with-bitlys-api-in-net/#comments</comments>
		<pubDate>Thu, 07 May 2009 18:34:02 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bitly]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[tinyurl]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/05/07/shortening-urls-with-bitlys-api-in-net/</guid>
		<description>I previously wrote about shortening URLs with TinyURL’s API but my new favorite URL shortener is http://bit.ly and it also has a great API that you can use from within your .net code.  I just recently used in my twitter contest website – tweetastica.
The code is also very simple.  I didn’t add all the extra [...]</description>
			<content:encoded><![CDATA[<p>I previously wrote about shortening URLs with <a href="http://www.emadibrahim.com/2008/04/15/shortening-urls-using-tinyurl-api-in-net/">TinyURL’s API</a> but my new favorite URL shortener is <a href="http://bit.ly">http://bit.ly</a> and it also has a great API that you can use from within your .net code.  I just recently used in my twitter contest website – <a href="http://tweetastica.com">tweetastica</a>.</p>
<p>The code is also very simple.  I didn’t add all the extra options that the API makes available and just wrote enough for me to shorten a URL.  Here it is:</p>
<div>
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static class</span> BitlyApi
{
    <span style="color: #0000ff">private</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> apiKey = <span style="color: #006080">"[add api key here]"</span>;
    <span style="color: #0000ff">private</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> login = <span style="color: #006080">"[add login name here]"</span>;

    <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> BitlyResults ShortenUrl(<span style="color: #0000ff">string</span> longUrl)
    {
        var url =
            <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">"http://api.bit.ly/shorten?format=xml&amp;version=2.0.1&amp;longUrl={0}&amp;login={1}&amp;apiKey={2}"</span>,
                          HttpUtility.UrlEncode(longUrl), login, apiKey);
        var resultXml = XDocument.Load(url);
        var x = (from result <span style="color: #0000ff">in</span> resultXml.Descendants(<span style="color: #006080">"nodeKeyVal"</span>)
                 select <span style="color: #0000ff">new</span> BitlyResults
                            {
                                UserHash = result.Element(<span style="color: #006080">"userHash"</span>).Value,
                                ShortUrl = result.Element(<span style="color: #006080">"shortUrl"</span>).Value
                            }
                );
        <span style="color: #0000ff">return</span> x.Single();
    }
}

<span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> BitlyResults
{
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> UserHash { get; set; }

    <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> ShortUrl { get; set; }
}</pre>
</div>
<p>Using this code is very straight forward.</p>
<div>
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">var shortUrl = BitlyApi.ShortenUrl(<span style="color: #006080">"http://www.verylongUrl.com"</span>).ShortUrl;</pre>
</div>
<p>bit.ly has tons of features and a great API.  You can even see stats of any bit.ly generate url using /info.  for example: <a href="http://bit.ly/info/S0vRy">http://bit.ly/info/S0vRy</a> shows you stats for <a href="http://bit.ly/S0vRy">http://bit.ly/S0vRy</a></p>
<p>Another feature I really like is their bookmarklet which you can keep on your browser’s bookmark bar and click it to shrink the site you are at…  It even pops this side bar with a bunch of useful info.</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2009/05/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.emadibrahim.com/wp-content/uploads/2009/05/image-thumb.png" border="0" alt="image" width="410" height="298" /></a></p>
<p>The API is pretty well documented at <a href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation">http://code.google.com/p/bitly-api/wiki/ApiDocumentation</a></p>
<p>Don’t forget to follow me on <a href="http://twitter.com/eibrahim" target="_blank">twitter</a>.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/15/shortening-urls-using-tinyurl-api-in-net/" rel="bookmark" title="Permanent Link: Shortening URLs Using TinyUrl API in .net" >Shortening URLs Using TinyUrl API in .net</a></span><div class="aizattos_related_posts_excerpt">Here is a quick method to shorten URLs using the TinyUrl API in .net - C# and VB
C#

public stati...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/31/calling-the-wordpress-xmlrpc-api-from-vbnet/" rel="bookmark" title="Permanent Link: Calling the WordPress XMLRPC API from VB.net" >Calling the WordPress XMLRPC API from VB.net</a></span><div class="aizattos_related_posts_excerpt">As an example, I will call the getCategories API method.

Add a reference to the XML-RPC.net libra...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/11/yonkly-open-source-twitter/" rel="bookmark" title="Permanent Link: Yonkly &#8211; Open Source Twitter" >Yonkly &#8211; Open Source Twitter</a></span><div class="aizattos_related_posts_excerpt">[update: Yonkly source code is now public]

[update 2: I just created www.isweat.com using the yon...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/09/02/google-chrome-javascript-speed-test/" rel="bookmark" title="Permanent Link: Google Chrome JavaScript Speed Test" >Google Chrome JavaScript Speed Test</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/04/18/shrink-long-urls-easily-in-firefox/" rel="bookmark" title="Permanent Link: Shrink long URLs easily in FireFox" >Shrink long URLs easily in FireFox</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/1pdmvemIiyyTS4qLEPjM3tE42AE/0/da"><img src="http://feedads.g.doubleclick.net/~a/1pdmvemIiyyTS4qLEPjM3tE42AE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1pdmvemIiyyTS4qLEPjM3tE42AE/1/da"><img src="http://feedads.g.doubleclick.net/~a/1pdmvemIiyyTS4qLEPjM3tE42AE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/qSzaLyrwOvs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/05/07/shortening-urls-with-bitlys-api-in-net/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/05/07/shortening-urls-with-bitlys-api-in-net/</feedburner:origLink></item>
		<item>
		<title>“I Quit” 1 Year Anniversary</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/sOe0m3_JVdY/</link>
		<comments>http://www.emadibrahim.com/2009/03/09/i-quit-1-year-anniversary/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 11:13:44 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Startup]]></category>
		<category><![CDATA[Yonkly]]></category>
		<category><![CDATA[aspnetmvc]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/?p=603</guid>
		<description>It has been a year since I quit my job and decided to go independent.  I didn&amp;#8217;t know what I was going to do, the economic outlook wasn&amp;#8217;t good, I had two rental properties and a condo that I didn&amp;#8217;t know how I was going to pay for.  I was armed with only hope, ambition, [...]</description>
			<content:encoded><![CDATA[<div>It has been a year since <a href="http://www.emadibrahim.com/2008/03/20/i-quit/">I quit</a> my job and decided to go independent.  I didn&#8217;t know what I was going to do, the economic outlook wasn&#8217;t good, I had two rental properties and a condo that I didn&#8217;t know how I was going to pay for.  I was armed with only hope, ambition, credit cards and my fiancé&#8217;s love &amp; support.</div>
<div></div>
<div>The first three months, I toyed around with different and random ideas, I read lots of technical books and online material.  I learned a ton of stuff and in the process I launched an open source project called <a href="http://yonkly.com">Yonkly</a> that was written using Microsoft&#8217;s newest web framework &#8211; <a href="http://www.asp.net/mvc/">asp.net mvc</a>.</div>
<div></div>
<div>Yonkly was initially a Twitter clone, it was free and it was open source.  Feedback was positive for the most part and I kept getting requests for customization and installation.  One of my first clients was <a href="http://isweat.com">isweat.com</a> which was a custom version of Yonkly.  This was a good deal because I was getting paid to add more features to Yonkly as well as have a good reference client.  I was also lucky to have a great client <a href="http://www.ryanlee.com/">Ryan Lee</a> &#8211; who is just an all around great guy and pays on time &#8211; actually ahead of time.</div>
<div></div>
<div>
<div>I kept getting more praises on Yonkly and more requests for customization.  That&#8217;s when I thought to myself that there seem to be a market for this things.  It looks like people want to create their own Twitter-like website for whatever reason.  Some wanted to cultivate a community around a niche topic, some wanted to generate money with ads, some wanted to communicate/collaborate within a group/team/company.  Regardless of the reason, there seemed to be enough demand to take this to the next level.</div>
<div></div>
<div>I was confused (and still am) on which direction to go.  There was the Wordpress direction &#8211; offer a free, open source, extensible platform à la wordpress.org with an accompanying free hosted version à la wordpress.com.  There was the Ning direction &#8211; offer a hosted, subscription-based product à la <a href="http://ning.com">Ning</a> that lets anyone create their own microblog with zero-friction.  I kept going back and forth and finally settled on a hybrid model that leans more to the ning model.  I still kept the open source version out there (albeit it is outdated).  I chose a subscription-based model because I was tired of all these eyeball-centered business models with ads as their only revenue.  I wanted to create a sustainable business that will generate predictable recurring revenue.  The result was the birth of the hosted version of Yonkly &#8211; currently at <a href="http://yonkly.com">yonkly.com</a>.</div>
<div></div>
<div>Similar to ning, Yonkly allows you to easily create a microblog by simply selecting a name and a url.  You can create soccermoms.yonkly.com and voila, you got yourself a Twitter-like website focused around soccer moms.  If this is a small community then you can set it up for free.  My first release had 3 plans priced at 25, 50 and 100, I quickly realized that these were ridiculously high prices.  I also realized that people like, no LOVE free stuff.  I quickly adapted by introducing a free plan and changing the prices to 5, 15 and 25 with even reduced prices for annual subscriptions.</div>
<div></div>
<div>The cool thing about Yonkly is its approach to white-labeling.  If you are a premium subscriber, you can create a site with your own domain, your own look and feel and with no mention of Yonkly anywhere.  Good examples of that is <a href="http://isweat.com">isweat.com</a> and <a href="http://blogpei.com">blogpei.com</a>.  Yonkly has come a long way and now has thousands of users and over 1600 networks hosted on it.  It is also profitable.  I know that is hard to believe in this day and age.  I am not rich off Yonkly (yet) and it won&#8217;t pay my mortgage BUT it pays for itself and then some.  I have some really big plans for Yonkly which I will discuss in a future post.</div>
<div></div>
<div>
<div>So that was the story of Yonkly thus far; about 3  or 4 months after I quit my job, I accidently :) signed a book deal with Wiley Wrox on ASP.NET MVC and Test Driven Development (TDD).  It has always been a dream of mine to write a book, so I was really excited.  I won&#8217;t get rich of the book but I think it is an excellent learning experience and a great résumé filler.  It forced me to get better about the book&#8217;s subject and to get better at writing in general.  It also made me appreciate the amount of work that goes into each book.</div>
<div></div>
<div>I thought it was going to be an easy task, I mean, all I have to do is write.  Right?  Wrong, that was so far from the truth.  I was cranking out an average of 3 pages a day &#8211; a mind numbingly slow rate.  It wasn&#8217;t consistent either.  Sometimes, I will write 15 pages in 3 hours and then spend 2 weeks writing the next 15.  Sometimes I also feel that I can talk about a specific topic for 20 pages and then 2 paragraphs in, I realize that I got nothing else to say.  It has been an interesting experience.  The good news is that I am pretty much done with the book now and it should be published by May.</div>
<div></div>
<div>In conclusion, a year after I quit my job here are the end results:</div>
<div></div>
<div><strong>Bad</strong>:</div>
<div>
<ul>
<li>Huge credit card debt</li>
<li>Possibility of foreclosure on rental properties</li>
<li>Zero financial security</li>
<li>No stable income</li>
<li>Unpredictable outcome</li>
</ul>
</div>
<div><strong>Good</strong>:</div>
<div>
<ul>
<li><a href="http://www.emadibrahim.com/category/yonkly/">Yonkly launched</a> &#8211; officially my first web 2.0 service built from scratch</li>
<li><a href="http://www.emadibrahim.com/category/mvc-book/">Wrote a book</a> &#8211; to be published soon by Wiley Wrox</li>
<li>Proposed to my girlfriend (Laura) &#8211; she said yes</li>
<li>Adopted a puppy.  His name is Mac, we also considered naming him Dot com, Google, C# and Web.</li>
</ul>
</div>
<p style="text-align: center"><a href="http://www.emadibrahim.com/wp-content/uploads/2009/03/001e089e-eac8-441a-a30c-c7c817aa016b.jpg"><img class="size-medium wp-image-604 aligncenter" title="001e089e-eac8-441a-a30c-c7c817aa016b" src="http://www.emadibrahim.com/wp-content/uploads/2009/03/001e089e-eac8-441a-a30c-c7c817aa016b-300x225.jpg" alt="001e089e-eac8-441a-a30c-c7c817aa016b" width="300" height="225" /></a></p>
<div>Overall, I am glad I quit my job.  Other than the fact that I am broke, I learned and accomplished a lot and ready to take Yonkly to the next level.</div>
<div></div>
<div>You can follow me on twitter at <a href="http://twitter.com/eibrahim">twitter.com/eibrahim</a> for more updates and to track the progress of Yonkly, check out the blog at <a href="http://blog.yonkly.com">blog.yonkly.com</a> or follow it at <a href="http://twitter.com/yonkly">twitter.com/yonkly</a>.</div>
</div>
</div>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/" rel="bookmark" title="Permanent Link: Startup &#8211; How To Build A Web 2.0 Business: The Risks" >Startup &#8211; How To Build A Web 2.0 Business: The Risks</a></span><div class="aizattos_related_posts_excerpt">If you have been reading along, I probably sound like a broken record, talking about how I quit my j...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/06/27/free-it-consultation-in-the-dc-metro-area/" rel="bookmark" title="Permanent Link: Free IT Consultation in the DC Metro Area" >Free IT Consultation in the DC Metro Area</a></span><div class="aizattos_related_posts_excerpt">I have been busy working on several things since I quit my job.&nbsp; Things like the open source tw...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" rel="bookmark" title="Permanent Link: Services Worth Paying For as a Startup" >Services Worth Paying For as a Startup</a></span><div class="aizattos_related_posts_excerpt">[Update: added crowdsound] If you have been reading my blog or following me on Twitter then you alre...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/20/i-quit/" rel="bookmark" title="Permanent Link: I quit" >I quit</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/09/20/the-ultimate-rejection-letter/" rel="bookmark" title="Permanent Link: The Ultimate Rejection Letter" >The Ultimate Rejection Letter</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/X3k73ge4Z8gKHcoKmY83v60AoRs/0/da"><img src="http://feedads.g.doubleclick.net/~a/X3k73ge4Z8gKHcoKmY83v60AoRs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/X3k73ge4Z8gKHcoKmY83v60AoRs/1/da"><img src="http://feedads.g.doubleclick.net/~a/X3k73ge4Z8gKHcoKmY83v60AoRs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/sOe0m3_JVdY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/03/09/i-quit-1-year-anniversary/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/03/09/i-quit-1-year-anniversary/</feedburner:origLink></item>
		<item>
		<title>Yonkly in Top 25 Social Networks?</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/dZ6FF9Z9gUQ/</link>
		<comments>http://www.emadibrahim.com/2009/02/12/yonkly-in-top-25-social-networks/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 16:31:08 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Yonkly]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/02/12/yonkly-in-top-25-social-networks/</guid>
		<description>There is a blog post on compete.com&amp;#8217;s blog about the top 25 social networks.  As expected, Facebook is on top spot and Twitter has climbed to 3rd.  What is interesting to me though is the fact that Ning is number 12.  That validates Yonkly&amp;#8217;s business model and direction and as Twitter&amp;#8217;s popularity (and microblogs in [...]</description>
			<content:encoded><![CDATA[<p>There is a blog post on compete.com&#8217;s blog about the <a href="http://blog.compete.com/2009/02/09/facebook-myspace-twitter-social-network/">top 25 social networks</a>.  As expected, Facebook is on top spot and Twitter has climbed to 3rd.  What is interesting to me though is the fact that Ning is number 12.  That validates Yonkly&#8217;s business model and direction and as Twitter&#8217;s popularity (and microblogs in general) grow, so will Yonkly.</p>
<p>Yonkly offers a white-label platform that enables anyone and everyone to create a twitter-clone/microblog network for anything.  The same way Ning allows you to create a Facebook-clone/social network.  Just like Ning, Yonkly offers a hosted solution that is fully customizable.  For as little as 5 bucks a month, you have your own Twitter-clone that you don&#8217;t have to install, maintain or upgrade.  It just works.</p>
<blockquote><p>You can have your own look and feel (<a href="http://christtr.com">christtr.com</a>).</p>
<p>You can have your own domain (<a href="http://isweat.com">isweat.com</a>).</p>
<p>You can target any niche market (<a href="http://photographersjournal.yonkly.com">photographersjournal.com</a>).</p>
<p>You can even run your own advertising if you want and make some money (<a href="http://writezoo.com">writezoo.com</a>).</p>
<p>You can create private networks for your company, team, group or anything.</p>
<p>You can integrate with Flickr, Picasa and Twitter (more integration points coming soon).</p>
<p>There are ton more features, check out the tour <a href="http://yonkly.com/home/tour">over here</a>.</p></blockquote>
<p><a href="http://siteanalytics.compete.com/shoutem.com+buzzable.com+twingr.com+yonkly.com/?metric=uv"><img src="http://grapher.compete.com/shoutem.com+buzzable.com+twingr.com+yonkly.com_uv_460.png" alt="" /></a></p>
<p>It is very possible that <strong>one day Yonkly will be in the top 25 list</strong>.  In the meantime, why don&#8217;t you go create a free account and try it out at <a href="http://yonkly.com">yonkly.com</a></p>
<p>PS: Don&#8217;t want a hosted solution?  Prefer to host your own?  No problem, we are selling the source code, <a href="http://yonkly.com/buy">click here</a> for more info.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/" rel="bookmark" title="Permanent Link: Yonkly Making Progress" >Yonkly Making Progress</a></span><div class="aizattos_related_posts_excerpt">I have two reasons to celebrate.&#160; Yonkly's team has doubled in size.&#160; That is 200% growth....</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/09/startup-next-steps/" rel="bookmark" title="Permanent Link: Startup: Next Steps" >Startup: Next Steps</a></span><div class="aizattos_related_posts_excerpt">Yonkly has been out for a couple of months now and is doing very well.&#160; We have 1000+ networks ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/06/24/yonkly-groups-and-new-look/" rel="bookmark" title="Permanent Link: Yonkly Groups and new Look" >Yonkly Groups and new Look</a></span><div class="aizattos_related_posts_excerpt">We finally got around to releasing a new version of yonkly.&nbsp; We have cleaned up the look and fe...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/" rel="bookmark" title="Permanent Link: Yonkly Source Code For Sale" >Yonkly Source Code For Sale</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/29/yonkly-source-code/" rel="bookmark" title="Permanent Link: Yonkly Source Code" >Yonkly Source Code</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/TwCAEiLtShN1rYBgcDNKAD5-bHY/0/da"><img src="http://feedads.g.doubleclick.net/~a/TwCAEiLtShN1rYBgcDNKAD5-bHY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TwCAEiLtShN1rYBgcDNKAD5-bHY/1/da"><img src="http://feedads.g.doubleclick.net/~a/TwCAEiLtShN1rYBgcDNKAD5-bHY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/dZ6FF9Z9gUQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/02/12/yonkly-in-top-25-social-networks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/02/12/yonkly-in-top-25-social-networks/</feedburner:origLink></item>
		<item>
		<title>Services Worth Paying For as a Startup</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/30wDpqDWEeE/</link>
		<comments>http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:12:46 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Startup]]></category>
		<category><![CDATA[Yonkly]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/</guid>
		<description>[Update: added crowdsound]
If you have been reading my blog or following me on Twitter then you already know that I quit my job almost a year ago and launched my first startup (Yonkly) a few months ago.
The economy sucks, we are bootstrapped and doing whatever it takes to survive &amp;#8211; I hope that kid I [...]</description>
			<content:encoded><![CDATA[<p><strong>[Update: added crowdsound]</strong></p>
<p>If you have been reading my blog or following me on <a href="http://twitter.com/eibrahim" target="_blank">Twitter</a> then you already know that <a href="http://www.emadibrahim.com/2008/03/20/i-quit/" target="_blank">I quit</a> my job almost a year ago and launched my first startup (<a href="http://yonkly.com" target="_blank">Yonkly</a>) a few months ago.</p>
<p>The economy sucks, we are bootstrapped and doing whatever it takes to survive &#8211; I hope that kid I stole the sandwich from will understand.&nbsp; As a startup, we need to cut the fat (not that there is any) and make sure we only pay for things we need (and no, you don&#8217;t need a subscription to Playboy).</p>
<p>I thought, I would come up with a list of online (and offline services) that are worth paying for.&nbsp; Feel free to leave a comment with links to services that you use and think are worth the money.</p>
<p><a href="https://www.freshbooks.com/subscribe.php?ref=fccf620d113202-1" target="_blank">FreshBooks</a>: A great way to track your time and invoice your clients (until your startup takes off).&nbsp; I am currently using their free plan but they have plans starting at $14/month</p>
<p><a href="http://www.basecampHQ.com/?referrer=EMADIBRAHIM" target="_blank">Basecamp</a>: Really easy project management on the web.&nbsp; They have a free version and plans start at $12/month</p>
<p><a href="http://www.dreamhost.com/r.cgi?307988" target="_blank">DreamHost</a>: A very affordable way to host your blogs and websites I must have over 30 websites hosted with them for a ridiculously low fee.&nbsp; It is so low, I want to pay extra with my bill (but I won&#8217;t).</p>
<p><a href="http://www.woothemes.com/amember/go.php?r=4773&amp;i=b0" target="_blank">WooThemes</a>: Impress your customers with a killer WordPress theme.&nbsp; These are some of the best themes I have seen anywhere.&nbsp; We are currently using it on the Yonkly blog.</p>
<p><a href="http://animoto.com/?ref=qokbczwn" target="_blank">Animoto</a>: So you have decided to raise some money and want to create an interesting video to put on your homepage.&nbsp; Unfortunately you are as artistically talented as box of donuts (no offense Krispy Kream).&nbsp; This is a killer way to create a video, go and try it out, you can create a 30 second video for free.&nbsp; Here is the video I created for Yonkly, it took me less than 30 minutes. </p>
</p>
<div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:d484b9f2-e7b1-4b9d-9813-4d94be1ec9e0" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<div id="3db2f756-1e2b-4356-8803-50fab0a4028c" style="margin: 0px; padding: 0px; display: inline;">
<div><a href="http://www.youtube.com/watch?v=AcgZH3lzrBM" target="_new"><img src="http://www.emadibrahim.com/wp-content/uploads/2009/01/videoadd0c0084261.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('3db2f756-1e2b-4356-8803-50fab0a4028c'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/AcgZH3lzrBM\&quot;&gt;&lt;\/param&gt;&lt;param name=\&quot;wmode\&quot; value=\&quot;transparent\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/AcgZH3lzrBM\&quot; type=\&quot;application/x-shockwave-flash\&quot; wmode=\&quot;transparent\&quot; width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt=""></a></div>
</div>
</div>
<p>&nbsp;</p>
<p><a href="http://www.angelsoft.net" target="_blank">Angelsoft.net</a>: Speaking of raising money, try this site.&nbsp; I signed up and paid $250 to have my application submitted to thousands of potential investors and investor groups.&nbsp; <strong>Warning: </strong>It has only been 3 days since I subscribed to it, so I don&#8217;t know how effective it is.&nbsp; I personally like the fact that I can reach so many investors very quickly it&#8217;s like monster.com for entrepreneurs/investors.&nbsp; But don&#8217;t get your hopes too high, only 5% get funded.&nbsp; Here are some stats <a title="http://angelsoft.net/industry/index.seam" href="http://angelsoft.net/industry/index.seam">http://angelsoft.net/industry/index.seam</a></p>
<p><a href="http://www.streamsend.com/291.html" target="_blank">StreamSend</a>: Now that you have 15 thousand people signed up to receive your newsletter announcing the grand opening (or closing) of your startup, you need a way to send bulk email.&nbsp; StreamSend is the cheapest I could find.&nbsp; Not that best, but the cheapest. </p>
<p><a href="www.rmilk.com" target="_blank">Remember The Milk</a> (RTM): Stay organized and productive with Remember The Milk.&nbsp; They are everywhere: on the web, on your iphone, in your gmail inbox, in your gmail calendar on your windows and mac desktop, in your iGoogle start page and even integrates with QuickSilver on the mac and Launchy on the pc.&nbsp; It&#8217;s free but I pay $25/year to use their iPhone app (that&#8217;s 25 a YEAR).&nbsp; One drawback: it doesn&#8217;t <a href="http://www.emadibrahim.com/2008/04/14/synchronize-outlook-tasks-with-remember-the-milk/" target="_blank">sync withOutlook</a>&nbsp;&nbsp; </p>
<p><a href="http://tinyurl.com/crygue" target="_blank">Amazon Prime</a>: If you are going to buy a ton of book to tell you how to market/sell/buy/start/ a business or how to work <a href="http://tinyurl.com/c4yft7" target="_blank">4 hours a week</a> and live your dream then you should subscribe to Amazon Prime.&nbsp; It gives you free shipping on pretty much everything at Amazon for $75 a year.</p>
<p><a href="http://aws.amazon.com/" target="_blank">Amazon Web Services</a>: The best way to reduce your bandwidth and online storage.&nbsp; I use S3, CloudFront, Elastic Compute Cloud and SimpleDB.&nbsp; I even created a <a href="http://www.sdbmanager.com/" target="_blank">SimpleDB manager</a>, which you should buy a copy of.&nbsp; Legend has it that for every copy sold a terrorist is captured.&nbsp; You don&#8217;t believe?&nbsp; I sold a copy the day John Walker (the terrorist not the drink) was captured.&nbsp; Coincidence?&nbsp; I don&#8217;t think so.</p>
<p><a href="http://www.joesgoals.com" target="_blank">Joe&#8217;s Goals</a>: Set some goals, track them and celebrate your achievements (or cry yourself to sleep, loser).&nbsp; It&#8217;s free, but you can pay $12/year to have the ads removed.&nbsp; I will take my ads now, please.</p>
<p><a href="http://www.crowdsound.com" target="_blank">CrowdSound</a>: A great way to collect user feedback.&nbsp; They have a free plan and plans starting at $10/month.&nbsp; Definitely worth the money.</p>
<p>And of course, the myriad of Google tools and services out there: <a href="http://docs.google.com" target="_blank">Docs</a>, <a href="http://calendar.google.com" target="_blank">Calendar</a>, <a href="http://gmail.com" target="_blank">Mail</a>, <a href="http://analytics.google.com" target="_blank">Analytics</a>, <a href="http://reader.google.com" target="_blank">Reader</a>.&nbsp; They are all free but you have to give up your soul to Google.&nbsp; But don&#8217;t worry, they will &#8220;do no evil&#8221;.&nbsp; Worst case, they will sell ads on your soul with SoulSense (still in beta).</p>
<p><strong>Please share with everyone services that you use and think are worth the money.</strong></p>
<p><strong>Hacker News</strong> users are stubborn and insist on commenting there.&nbsp; I can&#8217;t seem to convince them, so here is a link to their comments <a href="http://news.ycombinator.com/item?id=456422">http://news.ycombinator.com/item?id=456422</a></p>
<p><u>Disclaimer</u>: I am sure you noticed that most of the links have a referral code.&nbsp; Don&#8217;t worry, that didn&#8217;t affect my recommendations or integrity (what is that?).&nbsp; <u>I actually use all the services</u><strong> </strong>mentioned above.&nbsp; Plus we are bootstrapped and the economy is in the crapper so give me a break and use these links.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/" rel="bookmark" title="Permanent Link: Startup &#8211; How To Build A Web 2.0 Business: The Risks" >Startup &#8211; How To Build A Web 2.0 Business: The Risks</a></span><div class="aizattos_related_posts_excerpt">If you have been reading along, I probably sound like a broken record, talking about how I quit my j...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/06/14/how-much-is-your-domain-worth/" rel="bookmark" title="Permanent Link: How much is your domain worth?" >How much is your domain worth?</a></span><div class="aizattos_related_posts_excerpt">Check the price of your domain and how much you could potentially generate in advertising revenue at...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/09/startup-next-steps/" rel="bookmark" title="Permanent Link: Startup: Next Steps" >Startup: Next Steps</a></span><div class="aizattos_related_posts_excerpt">Yonkly has been out for a couple of months now and is doing very well.&#160; We have 1000+ networks ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/26/downsizing-my-budget/" rel="bookmark" title="Permanent Link: Downsizing My Budget" >Downsizing My Budget</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/09/24/free-icons-and-images/" rel="bookmark" title="Permanent Link: Free Icons and Images" >Free Icons and Images</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Rk-EP0LKvzlBbY9JF0ZgJOzCjvc/0/da"><img src="http://feedads.g.doubleclick.net/~a/Rk-EP0LKvzlBbY9JF0ZgJOzCjvc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Rk-EP0LKvzlBbY9JF0ZgJOzCjvc/1/da"><img src="http://feedads.g.doubleclick.net/~a/Rk-EP0LKvzlBbY9JF0ZgJOzCjvc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/30wDpqDWEeE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/</feedburner:origLink></item>
		<item>
		<title>Testing Web Apps With Selenium, Explorer and .NET</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/DEPMNKtIVB8/</link>
		<comments>http://www.emadibrahim.com/2009/01/19/testing-web-app-with-selenium-explorer-and-net/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 06:52:04 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/01/19/testing-web-app-with-selenium-explorer-and-net/</guid>
		<description>Here are the steps to run your Selenium tests against Internet Explorer.
Create the tests

Install Selenium IDE from http://seleniumhq.org
Record your tests in Firefox using the Selenium IDE 
Click File &amp;#62; Create New Test
Click the record button and create your test
Click the record button to stop the test
Save your test
Click Options &amp;#62; Format &amp;#62; C# to get [...]</description>
			<content:encoded><![CDATA[<p>Here are the steps to run your Selenium tests against Internet Explorer.</p>
<h2>Create the tests</h2>
<ol>
<li>Install Selenium IDE from <a title="http://seleniumhq.org" href="http://seleniumhq.org">http://seleniumhq.org</a>
<li>Record your tests in Firefox using the Selenium IDE <br /><a href="http://www.emadibrahim.com/wp-content/uploads/2009/01/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="352" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2009/01/image-thumb.png" width="262" border="0"></a>
<li>Click File &gt; Create New Test
<li>Click the record button and create your test
<li>Click the record button to stop the test
<li>Save your test
<li>Click Options &gt; Format &gt; C# to get the C# code <br /><a href="http://www.emadibrahim.com/wp-content/uploads/2009/01/image1.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="452" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2009/01/image-thumb1.png" width="463" border="0"></a> </li>
</ol>
<h2>Setup Selenium Remote Control (RC)</h2>
<ol>
<li>Download Selenium RC (it includes the server and all necessary files)
<li>Start the server by running selenium-server.jar in the selenium-server folder
<ol>
<li>You can double click it, or
<li>Open a command prompt and type: <br /><em>java -jar selenium-server.jar</em> </li>
</ol>
</li>
</ol>
<h2>Run the tests</h2>
<ol>
<li>Create a new class library project in Visual Studio.
<li>Reference the assemblies in the selenium RC folder related to .net
<li>Paste the generated code from step #7 above into a class file
<li>To test Internet Explorer, change the setup method to this <br /> 
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">[SetUp]
<span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> SetupTest()
{
    selenium = <span style="color: #0000ff">new</span> DefaultSelenium(<span style="color: #006080">"localhost"</span>, 4444, <span style="color: #006080">"*iexplore"</span>,
                                    <span style="color: #006080">"http://www.mywebsite.com/"</span>);
    selenium.Start();
    verificationErrors = <span style="color: #0000ff">new</span> StringBuilder();
}</pre>
</div>
<li>Run the tests with your favorite Runner &#8211; I use ReSharper </li>
</ol>
<p>A Selenium Core window opens up as well as an IE window and your tests will run.</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2009/01/image2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="218" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2009/01/image-thumb2.png" width="515" border="0"></a> </p>
<p>Jeremy blogged something very similar to this at <a title="http://codebetter.com/blogs/jeremy.miller/archive/2006/05/14/144666.aspx" href="http://codebetter.com/blogs/jeremy.miller/archive/2006/05/14/144666.aspx">http://codebetter.com/blogs/jeremy.miller/archive/2006/05/14/144666.aspx</a></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/08/08/software-virtualization/" rel="bookmark" title="Permanent Link: Software Virtualization" >Software Virtualization</a></span><div class="aizattos_related_posts_excerpt">&nbsp; Look ma, no virtualisation window: at Tech.Ed Australia today, Microsoft showed its new "Soft...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/25/web-design-toolbox/" rel="bookmark" title="Permanent Link: Web Design Toolbox" >Web Design Toolbox</a></span><div class="aizattos_related_posts_excerpt">Here is an excellent post with tons of links to all sort of web design sites, tools, resources, etc....</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/08/01/smartsniff-freeware-packet-sniffer-2/" rel="bookmark" title="Permanent Link: SmartSniff: Freeware Packet Sniffer" >SmartSniff: Freeware Packet Sniffer</a></span><div class="aizattos_related_posts_excerpt">&nbsp; SmartSniff: Freeware Packet Sniffer - Capture TCP/IP packets on your network adapter  here is...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/09/24/free-icons-and-images/" rel="bookmark" title="Permanent Link: Free Icons and Images" >Free Icons and Images</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/10/the-best-javascript-library/" rel="bookmark" title="Permanent Link: The Best JavaScript Library" >The Best JavaScript Library</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/CCLiwn_yWD8Qn8_XP9nh5WDacd0/0/da"><img src="http://feedads.g.doubleclick.net/~a/CCLiwn_yWD8Qn8_XP9nh5WDacd0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CCLiwn_yWD8Qn8_XP9nh5WDacd0/1/da"><img src="http://feedads.g.doubleclick.net/~a/CCLiwn_yWD8Qn8_XP9nh5WDacd0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/DEPMNKtIVB8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/01/19/testing-web-app-with-selenium-explorer-and-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/01/19/testing-web-app-with-selenium-explorer-and-net/</feedburner:origLink></item>
		<item>
		<title>Startup: Next Steps</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/38NoeKZyxg4/</link>
		<comments>http://www.emadibrahim.com/2009/01/09/startup-next-steps/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 17:12:32 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Startup]]></category>
		<category><![CDATA[Yonkly]]></category>
		<category><![CDATA[Lifestyle]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/01/09/startup-next-steps/</guid>
		<description>Yonkly has been out for a couple of months now and is doing very well.&amp;#160; We have 1000+ networks already created in every category imaginable from law to physical training to photography to religion &amp;#8211; even an adult network.
We have subscription plans and currently offering a discounted annual subscription* to celebrate the new year.&amp;#160; For [...]</description>
			<content:encoded><![CDATA[<p>Yonkly has been out for a couple of months now and is doing very well.&#160; We have 1000+ networks already created in every category imaginable from law to physical training to photography to religion &#8211; even an adult network.</p>
<p>We have <a href="http://yonkly.com/home/plans" target="_blank">subscription plans</a> and currently offering a discounted annual subscription* to celebrate the new year.&#160; For the technically-savvy, we even have the <a href="http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/" target="_blank">source code up for sale</a> .</p>
<h2>What Next?</h2>
<p>We have been contemplating the next step in our startup and want to hear your take on it.</p>
<p>Should we look for funding?&#160; Angel investors? VCs? Friends and Family?</p>
<p>If yes, then how much and in return for what?</p>
<p>If no, then why and what are the other options?</p>
<p>Do we sell?&#160; How much? How and to who?</p>
<h2>The Dream</h2>
<p>We are a dedicated and highly motivated team of entrepreneurs that want to achieve a 4HWW lifestyle and not work ourselves to the grave.&#160; With that in mind is getting investors a good idea?</p>
<h2>Exit: A Good Outcome</h2>
<p>We think the best outcome for us is having enough paid subscribers to pay our bills and more.&#160; A second best outcome is to sell the company and use the money to fund our next idea &#8211; we have a ton of ideas and lots of talent (that sounds conceited).&#160; Third outcome is to get funding so we can aggressively develop, market and grow the company.</p>
<p><strong>What do you think and why?</strong></p>
<p>* Discounted annual subscriptions of up to 33% off.&#160; <a href="http://yonkly.com" target="_blank">Create your network</a>, go to the admin control panel and click subscriptions.&#160;&#160; This is a limited-time offer, so if you don&#8217;t see it there, it probably expired.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/" rel="bookmark" title="Permanent Link: Startup &#8211; How To Build A Web 2.0 Business: The Risks" >Startup &#8211; How To Build A Web 2.0 Business: The Risks</a></span><div class="aizattos_related_posts_excerpt">If you have been reading along, I probably sound like a broken record, talking about how I quit my j...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/25/ruby-on-rails-for-a-net-developer/" rel="bookmark" title="Permanent Link: Ruby on Rails for a .NET Developer &#8211; Part 1" >Ruby on Rails for a .NET Developer &#8211; Part 1</a></span><div class="aizattos_related_posts_excerpt">Looking at my blog or resume, you will immediately know that I am a .net developer and my entire pro...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" rel="bookmark" title="Permanent Link: Services Worth Paying For as a Startup" >Services Worth Paying For as a Startup</a></span><div class="aizattos_related_posts_excerpt">[Update: added crowdsound] If you have been reading my blog or following me on Twitter then you alre...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/02/14/silverlight-tip-reverse-your-animation/" rel="bookmark" title="Permanent Link: Silverlight Tip &#8211; Reverse your animation" >Silverlight Tip &#8211; Reverse your animation</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/24/laser-sharp-focus/" rel="bookmark" title="Permanent Link: Laser-Sharp Focus" >Laser-Sharp Focus</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/4TApMkmfYSAPhpuiPSd8yF8_7kk/0/da"><img src="http://feedads.g.doubleclick.net/~a/4TApMkmfYSAPhpuiPSd8yF8_7kk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4TApMkmfYSAPhpuiPSd8yF8_7kk/1/da"><img src="http://feedads.g.doubleclick.net/~a/4TApMkmfYSAPhpuiPSd8yF8_7kk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/38NoeKZyxg4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/01/09/startup-next-steps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/01/09/startup-next-steps/</feedburner:origLink></item>
		<item>
		<title>Yonkly Source Code For Sale</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/E0JcJTQkK3A/</link>
		<comments>http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 13:57:39 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Yonkly]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/</guid>
		<description>You can now buy the best twitter-clone software out there complete with full source code for your customization pleasures.
Buy it now at http://yonkly.com/buy
Includes

Flexible license &amp;#8211; deploy up to 2 domains and 10 sub-domains 
Make any changes you want 
Community support through forums 
No copyright required
One time payment
Advanced control panel 
Groups 
Picture sharing 
Sidebar widgets 
Run [...]</description>
			<content:encoded><![CDATA[<p>You can now buy the best twitter-clone software out there complete with full source code for your customization pleasures.</p>
<p>Buy it now at <a href="http://yonkly.com/buy">http://yonkly.com/buy</a></p>
<h2>Includes</h2>
<ul>
<li>Flexible license &#8211; deploy up to <strong>2 domains</strong> and <strong>10 sub-domains</strong> </li>
<li>Make any changes you want </li>
<li>Community support through forums </li>
<li>No copyright required</li>
<li>One time payment</li>
<li>Advanced control panel </li>
<li>Groups </li>
<li>Picture sharing </li>
<li>Sidebar widgets </li>
<li>Run your own ads </li>
<li>Use your own domain </li>
<li>Threaded conversations </li>
<li>Twitter integration</li>
</ul>
<p>For more information visit <a href="http://yonkly.com/buy">http://yonkly.com/buy</a></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/09/startup-next-steps/" rel="bookmark" title="Permanent Link: Startup: Next Steps" >Startup: Next Steps</a></span><div class="aizattos_related_posts_excerpt">Yonkly has been out for a couple of months now and is doing very well.&#160; We have 1000+ networks ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/29/yonkly-source-code/" rel="bookmark" title="Permanent Link: Yonkly Source Code" >Yonkly Source Code</a></span><div class="aizattos_related_posts_excerpt">[UPDATE] Source code is now available in codeplex at http://www.codeplex.com/yonkly

I apologize f...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/09/yonkly-updated-05092008/" rel="bookmark" title="Permanent Link: Yonkly: Updated 05/09/2008" >Yonkly: Updated 05/09/2008</a></span><div class="aizattos_related_posts_excerpt">[update: Yonkly source code is now public]

We just released a new updated version younkly that is...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/" rel="bookmark" title="Permanent Link: Yonkly Making Progress" >Yonkly Making Progress</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/11/yonkly-open-source-twitter/" rel="bookmark" title="Permanent Link: Yonkly &#8211; Open Source Twitter" >Yonkly &#8211; Open Source Twitter</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/feYnjRtYnhf98wc3Ej-R4hB-RIE/0/da"><img src="http://feedads.g.doubleclick.net/~a/feYnjRtYnhf98wc3Ej-R4hB-RIE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/feYnjRtYnhf98wc3Ej-R4hB-RIE/1/da"><img src="http://feedads.g.doubleclick.net/~a/feYnjRtYnhf98wc3Ej-R4hB-RIE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/E0JcJTQkK3A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/</feedburner:origLink></item>
		<item>
		<title>A GUI for Amazon SimpleDb – SimpleDb Manager</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/5UKb1vYn6RQ/</link>
		<comments>http://www.emadibrahim.com/2008/12/22/a-gui-for-amazon-simpledb-simpledb-manager/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 15:24:35 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/12/22/a-gui-for-amazon-simpledb-simpledb-manager/</guid>
		<description>I just released a new software called SimpleDb Manager for managing your SimpleDb databases.&amp;#160; You can get it form www.sdbmanager.com and try it free for 30 days.&amp;#160; 
Since it is still in beta, I have reduced the price to $19.99 but only for a LIMITED time.&amp;#160; The price will go up as soon as the [...]</description>
			<content:encoded><![CDATA[<p>I just released a new software called SimpleDb Manager for managing your SimpleDb databases.&#160; You can get it form <a href="http://www.sdbmanager.com">www.sdbmanager.com</a> and try it free for 30 days.&#160; </p>
<p>Since it is still in beta, I have reduced the price to $19.99 but only for a LIMITED time.&#160; The price will go up as soon as the bugs are ironed out and we get out of beta (very soon).</p>
<p>So what can SimpleDb Manager do for you?</p>
<ul>
<li>Create and delete domains </li>
<li>Edit-In-Place item attributes (select the cell and start typing or hit F2 to edit) </li>
<li>Delete items (select row and hit the delete button) </li>
<li>Delete attributes (edit cell and delete its content) </li>
<li>Add new items (just start typing in the last row) </li>
<li>Execute queries (type query in query box and click the execute button) </li>
<li>Save connection information for easy management of multiple accounts</li>
</ul>
<p>There are a ton <strong>more features coming</strong>, so stay tuned.</p>
<p><font size="4"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=1933588" target="_blank">Get SimpleDb Manager NOW before the price goes up &#8211; I am serious.</a></font></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" rel="bookmark" title="Permanent Link: Services Worth Paying For as a Startup" >Services Worth Paying For as a Startup</a></span><div class="aizattos_related_posts_excerpt">[Update: added crowdsound] If you have been reading my blog or following me on Twitter then you alre...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/14/visual-studio-window-manager/" rel="bookmark" title="Permanent Link: Visual Studio Window Manager" >Visual Studio Window Manager</a></span><div class="aizattos_related_posts_excerpt">This is a great productivity plugin and time saver…  Have you ever wanted to have different window...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/04/04/amazon-context-links/" rel="bookmark" title="Permanent Link: Amazon Context Links" >Amazon Context Links</a></span><div class="aizattos_related_posts_excerpt">I just installed the amazon.com context links plugin and this post is to test it.  Let's see if it h...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/06/08/failed-to-generate-a-user-instance-of-sql-server-due-to-a-failure-in-starting-the-process-for-the-user-instance-the-connection-will-be-closed/" rel="bookmark" title="Permanent Link: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." >Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/08/13/iphoto-08-and-iptc/" rel="bookmark" title="Permanent Link: iPhoto &#8216;08 and IPTC" >iPhoto &#8216;08 and IPTC</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/4jf302MWbOmpFjRDZEhXw_t6u_4/0/da"><img src="http://feedads.g.doubleclick.net/~a/4jf302MWbOmpFjRDZEhXw_t6u_4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4jf302MWbOmpFjRDZEhXw_t6u_4/1/da"><img src="http://feedads.g.doubleclick.net/~a/4jf302MWbOmpFjRDZEhXw_t6u_4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/5UKb1vYn6RQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/12/22/a-gui-for-amazon-simpledb-simpledb-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/12/22/a-gui-for-amazon-simpledb-simpledb-manager/</feedburner:origLink></item>
		<item>
		<title>Yonkly Making Progress</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/vyxFqXvicLg/</link>
		<comments>http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 03:43:19 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Yonkly]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/</guid>
		<description>I have two reasons to celebrate.&amp;#160; Yonkly&amp;#8217;s team has doubled in size.&amp;#160; That is 200% growth.&amp;#160; Yes, we are two people now.&amp;#160; Scott Scheper has joined Yonkly and will be bringing a whole lot of experience, strategic planning, vision, direction and eventually a lot of money.
The second reason to celebrate: we finally popped the cherry [...]</description>
			<content:encoded><![CDATA[<p>I have two reasons to celebrate.&#160; Yonkly&#8217;s team has doubled in size.&#160; That is 200% growth.&#160; Yes, we are two people now.&#160; Scott Scheper has joined Yonkly and will be<a href="http://www.emadibrahim.com/wp-content/uploads/2008/11/champagne.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="191" alt="champagne" src="http://www.emadibrahim.com/wp-content/uploads/2008/11/champagne-thumb.jpg" width="244" align="right" border="0" /></a> bringing a whole lot of experience, strategic planning, vision, direction and eventually a lot of money.</p>
<p>The second reason to celebrate: we finally popped the cherry and sold our first enterprise copy of Yonkly (<a href="http://about.yonkly.com">http://about.yonkly.com</a>).&#160;&#160; Now, we just have to do it again a few thousand times.</p>
<p>Yonkly is now in private beta, but you can signup for an invitation at <a href="http://about.yonkly.com/">http://about.yonkly.com/</a>.&#160; It will be coming out shortly and it will be kicking some ass.&#160; If you can&#8217;t wait, you can always buy the latest version with source code for $399, go to <a href="http://about.yonkly.com/">http://about.yonkly.com/</a> enter your email and you will receive instructions.</p>
<p>You can follow Yonkly&#8217;s progress on our new blog at <a href="http://blog.yonkly.com">http://blog.yonkly.com</a> (it&#8217;s a work in progress).&#160; You can also follow us on twitter at <a href="http://twitter.com/yonkly">http://twitter.com/yonkly</a>&#160;</p>
<p>Back to work, we have got a lot to do and not enough time.</p>
<p>Also, don&#8217;t for get to check Scott&#8217;s blog is <a href="http://scottdig.com/">http://scottdig.com/</a></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/29/yonkly-source-code/" rel="bookmark" title="Permanent Link: Yonkly Source Code" >Yonkly Source Code</a></span><div class="aizattos_related_posts_excerpt">[UPDATE] Source code is now available in codeplex at http://www.codeplex.com/yonkly

I apologize f...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/" rel="bookmark" title="Permanent Link: Yonkly Source Code For Sale" >Yonkly Source Code For Sale</a></span><div class="aizattos_related_posts_excerpt">You can now buy the best twitter-clone software out there complete with full source code for your cu...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/02/12/yonkly-in-top-25-social-networks/" rel="bookmark" title="Permanent Link: Yonkly in Top 25 Social Networks?" >Yonkly in Top 25 Social Networks?</a></span><div class="aizattos_related_posts_excerpt">There is a blog post on compete.com's blog about the top 25 social networks.  As expected, Facebook...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/06/24/yonkly-groups-and-new-look/" rel="bookmark" title="Permanent Link: Yonkly Groups and new Look" >Yonkly Groups and new Look</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/20/i-quit/" rel="bookmark" title="Permanent Link: I quit" >I quit</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/6M9I2qybaPVNiV-4eWi9QIOYFpE/0/da"><img src="http://feedads.g.doubleclick.net/~a/6M9I2qybaPVNiV-4eWi9QIOYFpE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6M9I2qybaPVNiV-4eWi9QIOYFpE/1/da"><img src="http://feedads.g.doubleclick.net/~a/6M9I2qybaPVNiV-4eWi9QIOYFpE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/vyxFqXvicLg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/11/10/yonkly-making-progress/</feedburner:origLink></item>
		<item>
		<title>Marketing Your Services Using Affiliate Programs</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/DrSaYo0B-4s/</link>
		<comments>http://www.emadibrahim.com/2008/10/09/marketing-your-services-using-affiliate-programs/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 14:35:52 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Startup]]></category>
		<category><![CDATA[Yonkly]]></category>
		<category><![CDATA[affiliates]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[yonklyapp]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/10/09/marketing-your-services-using-affiliate-programs/</guid>
		<description>I just launched a hosted microblogging platform (aka twitter clone) at www.yonklyapp.com and right now I am looking into different ways to market it.
One approach to my marketing strategy is to use an affiliate program.&amp;#160; We have all seen affiliate programs for everything from selling t-shirts to selling domains.&amp;#160; The question I struggled with is [...]</description>
			<content:encoded><![CDATA[<p>I just launched a hosted microblogging platform (aka twitter clone) at <a href="http://www.yonklyapp.com">www.yonklyapp.com</a> and right now I am looking into different ways to market it.</p>
<p>One approach to my marketing strategy is to use an affiliate program.&#160; We have all seen affiliate programs for everything from selling t-shirts to selling domains.&#160; The question I struggled with is &quot;how much do I pay my affiliates?&quot;&#160; I want it to be fair, competitive and also motivational enough to encourage the affiliates to market it.</p>
<p>I found out that <a href="http://www.37signals.com/svn/posts/1063-launch-announcing-the-new-37signals-affiliate-program-with-recurring-income" target="_blank">37 Signals</a> pays 5% to their affiliates that sounds way too low.&#160; What would be a good percentage?&#160; 15%? 25%?&#160; The plan I came up with is a tiered approach which gradually increases your percentage from 10% to 50% &#8211; you can read more about it at <a href="http://www.yonklyapp.com/affiliates.aspx">http://www.yonklyapp.com/affiliates.aspx</a> and maybe even <a href="http://www.yonklyapp.com/affiliates.aspx" target="_blank">signup</a> to be an affiliate.&#160; The best part is that it is recurring.&#160; </p>
<p>So if you bring in a 100 customers, you will earn:</p>
<p>$200/month on the first 20   <br />$400/month on the next 20    <br />$600/month on the next 20    <br />$800/month on the next 20    <br />$1000/month on the last 20</p>
<p>That&#8217;s a total of <strong>$3000 EVERY MONTH</strong>.&#160; Isn&#8217;t that pretty damn good?&#160; Or not?&#160; I would love to hear your opinions.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/30/my-elevator-pitch/" rel="bookmark" title="Permanent Link: My Elevator Pitch" >My Elevator Pitch</a></span><div class="aizattos_related_posts_excerpt">I found this cool site that has a free wizard which helps you build your elevator (15 second) pitch....</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/09/24/free-icons-and-images/" rel="bookmark" title="Permanent Link: Free Icons and Images" >Free Icons and Images</a></span><div class="aizattos_related_posts_excerpt">If you are creating any type of software applications with a user interface, most likely you will ne...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/05/09/startup-how-to-build-a-web-20-business-the-risks/" rel="bookmark" title="Permanent Link: Startup &#8211; How To Build A Web 2.0 Business: The Risks" >Startup &#8211; How To Build A Web 2.0 Business: The Risks</a></span><div class="aizattos_related_posts_excerpt">If you have been reading along, I probably sound like a broken record, talking about how I quit my j...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/29/services-worth-paying-for-as-a-startup/" rel="bookmark" title="Permanent Link: Services Worth Paying For as a Startup" >Services Worth Paying For as a Startup</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/14/visual-studio-window-manager/" rel="bookmark" title="Permanent Link: Visual Studio Window Manager" >Visual Studio Window Manager</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/jdD8J2pGUu3d-Vlpogw4FQYnLk0/0/da"><img src="http://feedads.g.doubleclick.net/~a/jdD8J2pGUu3d-Vlpogw4FQYnLk0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jdD8J2pGUu3d-Vlpogw4FQYnLk0/1/da"><img src="http://feedads.g.doubleclick.net/~a/jdD8J2pGUu3d-Vlpogw4FQYnLk0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/DrSaYo0B-4s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/10/09/marketing-your-services-using-affiliate-programs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/10/09/marketing-your-services-using-affiliate-programs/</feedburner:origLink></item>
		<item>
		<title>Themes and ASP.NET MVC</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/qkb_QA6u-DE/</link>
		<comments>http://www.emadibrahim.com/2008/10/02/themes-and-aspnet-mvc/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 22:34:53 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/10/02/themes-and-aspnet-mvc/</guid>
		<description>I wanted to easily add theme support to yonkly, so that others can install it and modify its look and feel as they please.&amp;#160; I also wanted it to be as easy as installing a theme in wordpress.
I created a themes folder under the content folder
 
Then I referenced my css file in the master [...]</description>
			<content:encoded><![CDATA[<p>I wanted to easily add theme support to <a href="http://yonkly.com" target="_blank">yonkly</a>, so that others can install it and modify its look and feel as they please.&#160; I also wanted it to be as easy as installing a theme in <a href="http://wordpress.org" target="_blank">wordpress</a>.</p>
<p>I created a themes folder under the content folder</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image8.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="204" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb8.png" width="173" border="0" /></a> </p>
<p>Then I referenced my css file in the master page using a helper method</p>
<blockquote><p>&lt;%= ThemeHelper.GetCss() %&gt;</p>
</blockquote>
<p>I also use a helper method for images</p>
<blockquote><p>&lt;img src=&#8217;&lt;%=ThemeHelper.GetImageUrl(&quot;reply.png&quot;)%&gt;&#8217; alt=&quot;reply&quot; class=&quot;icon&quot; /&gt;</p>
</blockquote>
<p>But most of my images are set in the stylesheet, which makes it easier to manipulate different skins</p>
<p>The helper methods above look at the defined theme in the config file (or database or wherever you store your settings) and then return the path to the correct resource.</p>
<p>Take a look at these live samples:</p>
<ul>
<li><a href="http://www.yonkly.com">www.yonkly.com</a></li>
<li><a href="http://www.isweat.com">www.isweat.com</a></li>
<li><a href="http://www.hokietalk.com">www.hokietalk.com</a></li>
</ul>
<p>They are all using the same codebase but have a different theme defined.&#160; The trick is in making your HTML css-friendly by naming elements and assigning them classes as well as using Divs and avoiding tables.&#160; This allows you to create a stylesheet that radically changes the look of the site.&#160; Think of the element ids and classes as an API to your view, that the css can manipulate.</p>
<p>I also added a feature that lets you upload a folder theme as a zip file and have the application unzip it into the themes folder.</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image9.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="355" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb9.png" width="494" border="0" /></a> </p>
<p>It would be cool if we can define a &quot;virtual folder&quot; in our application, so I wouldn&#8217;t have to use helper methods.&#160; Imagine if you could just say /content/theme/logo.gif and it would just work.&#160; The theme folder doesn&#8217;t really exist but instead it would route to the correct folder based on a setting.&#160; I wonder if I can do that with current routing mechanism in asp.net mvc!!!&#160; Anyone?</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/" rel="bookmark" title="Permanent Link: Ajax with ASP.NET MVC Framework Preview 2" >Ajax with ASP.NET MVC Framework Preview 2</a></span><div class="aizattos_related_posts_excerpt">This is the updated version of the Nikhil's excellent example on how to use Ajax with ASP.net MVC.
...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/" rel="bookmark" title="Permanent Link: Deciding Between ASP.NET MVC and WebForms" >Deciding Between ASP.NET MVC and WebForms</a></span><div class="aizattos_related_posts_excerpt">I am trying to create a decision flowchart for my ASP.NET MVC book and wanted to get some community ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/05/resolving-url-in-aspnet-using-tilda/" rel="bookmark" title="Permanent Link: Resolving URL in ASP.net using Tilda (~)" >Resolving URL in ASP.net using Tilda (~)</a></span><div class="aizattos_related_posts_excerpt">I have been using .net since it has come out and I just found this out (so, I am kind of pissed).  W...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/11/aspnet-20-error-title-is-not-a-member-of-asp%e2%80%a6/" rel="bookmark" title="Permanent Link: asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…" >asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/30/upgrading-yonkly-to-aspnet-mvc-preview-3/" rel="bookmark" title="Permanent Link: Upgrading Yonkly to ASP.NET MVC Preview 3" >Upgrading Yonkly to ASP.NET MVC Preview 3</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/HOApRAU5pET-LxO6PFWf7HuMUKE/0/da"><img src="http://feedads.g.doubleclick.net/~a/HOApRAU5pET-LxO6PFWf7HuMUKE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HOApRAU5pET-LxO6PFWf7HuMUKE/1/da"><img src="http://feedads.g.doubleclick.net/~a/HOApRAU5pET-LxO6PFWf7HuMUKE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/qkb_QA6u-DE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/10/02/themes-and-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/10/02/themes-and-aspnet-mvc/</feedburner:origLink></item>
		<item>
		<title>Major Update to Yonkly: Widgets, Ads &amp; More</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/h0w-mUmRnLU/</link>
		<comments>http://www.emadibrahim.com/2008/10/01/major-update-to-yonkly-widgets-ads-more/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 17:39:50 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Yonkly]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/10/01/major-update-to-yonkly-widgets-ads-more/</guid>
		<description>I just released a new version of Yonkly with a ton of new features.
Widgets
If you are logged in, you can add a widget to your sidebar even place Google ads if you wanted.&amp;#160; Take a look at the widget in my profile at http://yonkly.com/eibrahim.&amp;#160; To add your own widget, go to settings and click the [...]</description>
			<content:encoded><![CDATA[<p>I just released a new version of <a href="http://yonkly.com">Yonkly</a> with a ton of new features.</p>
<h2>Widgets</h2>
<p>If you are logged in, you can add a widget to your sidebar even place Google ads if you wanted.&#160; Take a look at the widget in my profile at <a href="http://yonkly.com/eibrahim">http://yonkly.com/eibrahim</a>.&#160; To add your own widget, go to settings and click the widgets link then simply add your widget code and hit save</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="463" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb.png" width="385" border="0" /></a> </p>
<p>If you want your widget to fit nicely with the rest of the sidebar, click the link &quot;insert default widget&quot; and add your script in the correct place.</p>
<h2>Control Panel</h2>
<p>If you are the owner of the site i.e. an admin, you will have access to a control panel where you can customize a ton of things</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image1.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="170" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb1.png" width="244" border="0" /></a> </p>
<p><strong>Site Settings</strong></p>
<p>You can modify all sort of site settings such as title, description, keywords, amazon s3 information and so on.</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="337" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb2.png" width="170" border="0" /></a> </p>
<p><strong>Email Templates</strong></p>
<p>You can customize all the emails that get sent out e.g. &quot;someone is following&quot;, &quot;someone joined your group&quot;, &quot;thanks for signing up&quot;, etc.</p>
<p><strong>Ad Management</strong></p>
<p>Now, you can add advertisements to your site by adding the ads code in the appropriate location.&#160; You can add it as a banner in the sidebar or in the message stream.</p>
<p>Here is a sidebar ad, you can also skin to match the site</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image3.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="227" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb3.png" width="244" border="0" /></a> </p>
<p>Here is a banner ad</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image4.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="81" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb4.png" width="244" border="0" /></a></p>
<p>And here is an embedded ad in the message stream </p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image5.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="141" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb5.png" width="244" border="0" /></a> </p>
<p><strong>Theme Management</strong></p>
<p>You can change the theme of the site.&#160; For examples, check <a href="http://www.hokietalk.com">www.hokietalk.com</a> and <a href="http://www.isweat.com">www.isweat.com</a>.&#160; Here is the theme selection screen</p>
<p> <a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image6.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="368" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb6.png" width="512" border="0" /></a>
<p>&#160;</p>
<p><strong>Content Management</strong></p>
<p>See the TOS, privacy and contact us links in the footer, those are dynamically created and you can create other pages as well e.g. &quot;FAQ&quot;, &quot;Help&quot; and so on&#8230;&#160; You simply enter a page name and the content using a rich text editor</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/10/image7.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="314" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/10/image-thumb7.png" width="344" border="0" /></a> </p>
<p><strong>User Management</strong></p>
<p>This is just a way to assign/revoke admin privileges to users.</p>
<h2>The Future</h2>
<p>I am very excited about all the new features specially that the site owner and the user can display ads and <strong>make money</strong>.&#160;&#160; I can&#8217;t wait to release the new version.&#160; <a href="http://www.emadibrahim.com/contact/">Contact me</a> if you are interested in setting up your own microblogging platform.</p>
<p>Stay Tuned!!!</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2009/01/08/yonkly-source-code-for-sale/" rel="bookmark" title="Permanent Link: Yonkly Source Code For Sale" >Yonkly Source Code For Sale</a></span><div class="aizattos_related_posts_excerpt">You can now buy the best twitter-clone software out there complete with full source code for your cu...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/11/yonkly-open-source-twitter/" rel="bookmark" title="Permanent Link: Yonkly &#8211; Open Source Twitter" >Yonkly &#8211; Open Source Twitter</a></span><div class="aizattos_related_posts_excerpt">[update: Yonkly source code is now public]

[update 2: I just created www.isweat.com using the yon...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/29/yonkly-source-code/" rel="bookmark" title="Permanent Link: Yonkly Source Code" >Yonkly Source Code</a></span><div class="aizattos_related_posts_excerpt">[UPDATE] Source code is now available in codeplex at http://www.codeplex.com/yonkly

I apologize f...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/09/yonkly-updated-05092008/" rel="bookmark" title="Permanent Link: Yonkly: Updated 05/09/2008" >Yonkly: Updated 05/09/2008</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/14/yonkly-new-release-04-14-08/" rel="bookmark" title="Permanent Link: Yonkly: New Release 04-14-08" >Yonkly: New Release 04-14-08</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/DqZsybrDYwW-S439k-YNdfjxLg4/0/da"><img src="http://feedads.g.doubleclick.net/~a/DqZsybrDYwW-S439k-YNdfjxLg4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DqZsybrDYwW-S439k-YNdfjxLg4/1/da"><img src="http://feedads.g.doubleclick.net/~a/DqZsybrDYwW-S439k-YNdfjxLg4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/h0w-mUmRnLU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/10/01/major-update-to-yonkly-widgets-ads-more/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/10/01/major-update-to-yonkly-widgets-ads-more/</feedburner:origLink></item>
		<item>
		<title>A Good TDD Process Diagram?</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/hQPkHPejz-s/</link>
		<comments>http://www.emadibrahim.com/2008/09/22/a-good-tdd-process-diagram/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 14:50:33 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[MVC Book]]></category>
		<category><![CDATA[mvcbook]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/22/a-good-tdd-process-diagram/</guid>
		<description>I am trying to create a flow diagram that depicts the Test Driven Development process and I need your expertise/opinion/criticism in nailing it down.
Take a look below and let me know what is wrong, what is right and what can be done better.
 
I drew the above diagram based on my understanding of TDD and [...]</description>
			<content:encoded><![CDATA[<p>I am trying to create a flow diagram that depicts the Test Driven Development process and I need your expertise/opinion/criticism in nailing it down.</p>
<p>Take a look below and let me know what is wrong, what is right and what can be done better.</p>
<p align="center"><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image4.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="725" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb4.png" width="235" border="0" /></a> </p>
<p>I drew the above diagram based on my understanding of TDD and by referencing other diagrams that I found online.&#160; Specifically:</p>
<p align="center"><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image5.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="375" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb5.png" width="211" border="0" /></a> </p>
<p>from <a href="http://www.agiledata.org/essays/tdd.html">http://www.agiledata.org/essays/tdd.html</a></p>
<p align="center"><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image6.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="284" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb6.png" width="241" border="0" /></a> </p>
<p>from <a href="http://designindrive.com/?p=31">http://designindrive.com/?p=31</a></p>
<p align="center"><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image7.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="126" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb7.png" width="244" border="0" /></a> </p>
<p>from <a title="http://tinyurl.com/498pjg" href="http://tinyurl.com/498pjg">http://tinyurl.com/498pjg</a></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/" rel="bookmark" title="Permanent Link: Deciding Between ASP.NET MVC and WebForms" >Deciding Between ASP.NET MVC and WebForms</a></span><div class="aizattos_related_posts_excerpt">I am trying to create a decision flowchart for my ASP.NET MVC book and wanted to get some community ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/04/23/my-altnet-code/" rel="bookmark" title="Permanent Link: My ALT.NET Code" >My ALT.NET Code</a></span><div class="aizattos_related_posts_excerpt">Here is my alt.net code...  Click on the link to decode it.
IOC(SM):IOC(Nin):
MOC(MQ):
TDD(NU):T...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/18/the-best-ioc-container/" rel="bookmark" title="Permanent Link: The Best IoC Container?" >The Best IoC Container?</a></span><div class="aizattos_related_posts_excerpt">As I previously mentioned in my post "The Best JavaScript Library", I am in the process of developin...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/10/the-best-javascript-library/" rel="bookmark" title="Permanent Link: The Best JavaScript Library" >The Best JavaScript Library</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/06/08/failed-to-generate-a-user-instance-of-sql-server-due-to-a-failure-in-starting-the-process-for-the-user-instance-the-connection-will-be-closed/" rel="bookmark" title="Permanent Link: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." >Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/uBbDafSPkuyRJJ_b8k2MeqxCgbs/0/da"><img src="http://feedads.g.doubleclick.net/~a/uBbDafSPkuyRJJ_b8k2MeqxCgbs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/uBbDafSPkuyRJJ_b8k2MeqxCgbs/1/da"><img src="http://feedads.g.doubleclick.net/~a/uBbDafSPkuyRJJ_b8k2MeqxCgbs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/hQPkHPejz-s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/09/22/a-good-tdd-process-diagram/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/09/22/a-good-tdd-process-diagram/</feedburner:origLink></item>
		<item>
		<title>Client &amp; Server Side Validation in ASP.NET MVC</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/bwhnWxN--gw/</link>
		<comments>http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 22:58:24 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[aspnetmvc]]></category>
		<category><![CDATA[castle]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[MVC Book]]></category>
		<category><![CDATA[mvcbook]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/</guid>
		<description>[Update: The code is open-sourced at http://code.google.com/p/mvcvalidation/]
The asp.net mvc codeplex preview 5 version just came out a few days ago and it includes a lot nice enhancements.&amp;#160; For the best introduction read Scott&amp;#8217;s post.&amp;#160; 
Some of my favorite changes happened in validation.&amp;#160; Incidentally, I was already working on a post to talk about doing client [...]</description>
			<content:encoded><![CDATA[<p><font color="#ff0000">[<strong>Update</strong>: The code is open-sourced at </font><a href="http://code.google.com/p/mvcvalidation/"><font color="#ff0000">http://code.google.com/p/mvcvalidation/</font></a><font color="#ff0000">]</font></p>
<p>The asp.net mvc <a href="http://codeplex.com/aspnet" target="_blank">codeplex preview 5</a> version just came out a few days ago and it includes a lot nice enhancements.&#160; For the best introduction read Scott&#8217;s <a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx" target="_blank">post</a>.&#160; </p>
<p>Some of my favorite changes happened in validation.&#160; Incidentally, I was already working on a post to talk about doing client and server side validation the easy way.&#160; The inspiration came after reading <a href="http://blog.codeville.net/2008/04/30/model-based-client-side-validation-for-aspnet-mvc/" target="_blank">Steve Sanderson&#8217;s post</a> and watching his screencast on how he created a model-based client-side validation &#8211; very cool.</p>
<p>I want a simple way to perform client and server side validation for the application I am creating for <a href="http://www.emadibrahim.com/tag/mvcbook/">my book</a> and my objectives are simple (yet there is no easy way to do it):</p>
<ol>
<li>Have a model-based validation mechanism </li>
<li>Have the least amount of repetition (<a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself" target="_blank">DRY</a>) </li>
<li>Client side validation using jQuery </li>
<li>Server side validation </li>
</ol>
<p>First, I will show you how it works then I will explain how I got there.&#160; Here is my model class for a user</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> User</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> UserName { get; set; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> Email { get; set; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> Password { get; set; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> Guid ProviderId { get; set; }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   7:</span> }</pre>
</p></div>
</div>
<p>To add validation to it, I simply decorate it with the appropriate validation attributes.&#160; It ends up looking like this:</p>
</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> User
{
    [ValidateNonEmpty(<span style="color: #006080">&quot;Username is required&quot;</span>)]
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> UserName { get; set; }

    [ValidateNonEmpty(<span style="color: #006080">&quot;Email is required&quot;</span>)]
    [ValidateEmail(<span style="color: #006080">&quot;Invalid email address&quot;</span>)]
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> Email { get; set; }

    [ValidateNonEmpty(<span style="color: #006080">&quot;Password is required&quot;</span>)]
    [ValidateLength(4,50,<span style="color: #006080">&quot;Password should be at least 4 characters long&quot;</span>)]
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> <span style="color: #0000ff">string</span> Password { get; set; }

    <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> Guid ProviderId { get; set; }
}</pre>
</div>
<p>I then generate the client script by adding <strong>1 line of code</strong> to my view</p>
</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;%=Html.ClientSideValidation(<span style="color: #006080">&quot;formCreateList&quot;</span>, ViewData.Model) %&gt;</pre>
</div>
<p>On the server side, I simply make a call to a validation method from my controller</p>
</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">[Authorize]
[AcceptVerbs(<span style="color: #006080">&quot;POST&quot;</span>), ActionName(<span style="color: #006080">&quot;Create&quot;</span>)]
<span style="color: #0000ff">public</span> ActionResult Save(User newUser)
{
    AppHelper.ValidateModel(ViewData.ModelState, newUser);
    <span style="color: #008000">//the rest of the action code</span>
}</pre>
</div>
<p>If there are any validation errors on the server, I display the errors by using the framework helper method ValidationSummary.&#160; All I have to do is add this 1 line to the view</p>
</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;%=Html.ValidationSummary() %&gt;</pre>
</div>
<h2>JavaScript</h2>
<p>That&#8217;s all there is to it.&#160; Now let&#8217;s talk about how it works.&#160; The first challenge was generating the JavaScript to validate on the client.&#160; </p>
<p>I decided to use the excellent <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery Validation plugin</a>.&#160; The plugin gives me 2 ways to validate my form.&#160; The first method uses classes on the the fields to be validated, for example a required email field would look like this</p>
</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">id</span><span class="kwrd">=&quot;email&quot;</span> <span class="attr">name</span><span class="kwrd">=&quot;email&quot;</span> <span class="attr">size</span><span class="kwrd">=&quot;25&quot;</span>  <strong><span class="attr">class</span><span class="kwrd">=&quot;required email&quot;</span></strong> <span class="kwrd">/&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>The second method uses rules that are defined in JavaScript and look like this</p>
</p>
<pre class="csharpcode">&lt;script type=<span class="str">&quot;text/javascript&quot;</span>&gt;
$(<span class="str">&quot;#signupForm&quot;</span>).validate({
        rules: {
            email: {
                required: <span class="kwrd">true</span>,
                email: <span class="kwrd">true</span>
            }
        },
        messages: {
            email: <span class="str">&quot;Please enter a valid email address&quot;</span>
        }
    });
&lt;/script&gt;</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Check out the plugin <a href="http://docs.jquery.com/Plugins/Validation" target="_blank">documenation</a> and <a href="http://jquery.bassistance.de/validate/demo/" target="_blank">demos</a> to understand how it all works. </p>
<p>Since I was generating the script on the server and I wanted to make only one call, I went with the second option.</p>
<p>The script generator simply loops through all the model properties and their attributes and generate the appropriate script.&#160; <em>Afterthought: Now that I think about it, I could have easily generated a script to add classes to the elements using jQuery&#8217;s addClass method&#8230;&#160; Oh well, maybe someone else will be kind enough to do it.</em></p>
<h2>Castle Validator</h2>
<p>I used the Castle Validator Component as my validation framework.&#160; That&#8217;s where all the validation attributes you see above come from, but you can also create your own validators.&#160; I then created a class called JQueryValidationProvider that implements IBrowserValidationGenerator interface in the Castle.Components.Validator namespace.&#160; <em>I haven&#8217;t implemented the entire interface and only have a couple of validations working (I will update the source code when it is all done).</em>&#160; Here is a couple of methods that I implemented.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> SetEmail(<span style="color: #0000ff">string</span> target, <span style="color: #0000ff">string</span> violationMessage)
{
     Rules.Add(<span style="color: #0000ff">new</span> ValidationRule(Validate.Email, violationMessage));
}
<span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> SetAsRequired(<span style="color: #0000ff">string</span> target, <span style="color: #0000ff">string</span> violationMessage)
{
    Rules.Add(<span style="color: #0000ff">new</span> ValidationRule(Validate.Required, violationMessage));
}</pre>
</div>
<p>As you can see, all I am really doing is just adding the validation rule to List of ValidationRules.&#160; ValidationRule is a straight forward class and looks like this:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 364px; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">internal</span> <span style="color: #0000ff">class</span> ValidationRule
{
    <span style="color: #0000ff">public</span> ValidationRule(Validate validate) : <span style="color: #0000ff">this</span>(validate, <span style="color: #0000ff">null</span>) { }
    <span style="color: #0000ff">public</span> ValidationRule(Validate validate, <span style="color: #0000ff">string</span> failureMessage)
        : <span style="color: #0000ff">this</span>(validate, failureMessage, <span style="color: #0000ff">null</span>) { }
    <span style="color: #0000ff">public</span> ValidationRule(Validate validate, <span style="color: #0000ff">string</span> failureMessage, <span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>)
    {
        Validate = validate;
        Value = <span style="color: #0000ff">value</span>;
        <span style="color: #0000ff">if</span> (failureMessage != <span style="color: #0000ff">null</span>)
        {
            ErrorMessage = failureMessage;
        }
        <span style="color: #0000ff">else</span>
        {
            <span style="color: #008000">//setup default error messages</span>
            <span style="color: #0000ff">switch</span> (Validate)
            {
                <span style="color: #0000ff">case</span> Validate.Required:
                    ErrorMessage = <span style="color: #006080">&quot;This field is required&quot;</span>;
                    <span style="color: #0000ff">break</span>;
                <span style="color: #0000ff">default</span>:
                    ErrorMessage = <span style="color: #006080">&quot;Field error&quot;</span>;
                    <span style="color: #0000ff">break</span>;
            }
        }

    }
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">readonly</span> <span style="color: #0000ff">object</span> Value;
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">readonly</span> Validate Validate;
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">readonly</span> <span style="color: #0000ff">string</span> ErrorMessage;
}</pre>
</div>
<p>The helper ClientSideValidation method simply loops through the collection of rules and generate the appropriate JavaScript.&#160; Here it is</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">string</span> ClientSideValidation(this HtmlHelper htmlHelper,
    <span style="color: #0000ff">string</span> formName,
    <span style="color: #0000ff">object</span> modelToValidate)
{
    var results = <span style="color: #0000ff">new</span> StringBuilder();
    var rules = <span style="color: #0000ff">new</span> StringBuilder();
    var messages = <span style="color: #0000ff">new</span> StringBuilder();
    results.AppendFormat(<span style="color: #006080">&quot;$(\&quot;#{0}\&quot;).validate({1}&quot;</span>, formName, <span style="color: #006080">&quot;{&quot;</span>);
    results.AppendLine();
    rules.AppendFormat(<span style="color: #006080">&quot;rules: {0}&quot;</span>, <span style="color: #006080">&quot;{&quot;</span>);
    messages.AppendFormat(<span style="color: #006080">&quot;messages: {0}&quot;</span>, <span style="color: #006080">&quot;{&quot;</span>);

    var props = TypeDescriptor.GetProperties(modelToValidate.GetType());

    var propCounter = 0;
    <span style="color: #0000ff">foreach</span> (PropertyDescriptor prop <span style="color: #0000ff">in</span> props)
    {
        var generator = <span style="color: #0000ff">new</span> JQueryValidationProvider();
        <span style="color: #0000ff">foreach</span> (var attrib <span style="color: #0000ff">in</span> prop.Attributes.OfType&lt;AbstractValidationAttribute&gt;())
        {
            var v = attrib.Build();
            v.ErrorMessage = v.ErrorMessage ?? <span style="color: #006080">&quot;*&quot;</span>;
            v.Initialize(<span style="color: #0000ff">new</span> CachedValidationRegistry(), <span style="color: #0000ff">null</span>);
            v.ApplyBrowserValidation(<span style="color: #0000ff">null</span>, InputElementType.Undefined,
                                     generator, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>);
        }

        <span style="color: #0000ff">if</span> (generator.Rules.Count &gt; 0)
        {
            <span style="color: #0000ff">if</span> (propCounter &gt; 0)
            {
                rules.Append(<span style="color: #006080">&quot;,&quot;</span>);
                messages.Append(<span style="color: #006080">&quot;,&quot;</span>);
            }
            rules.AppendLine();
            messages.AppendLine();
            rules.AppendFormat(<span style="color: #006080">&quot;{0}: {1}&quot;</span>, prop.Name.ToLower(), <span style="color: #006080">&quot;{&quot;</span>);
            messages.AppendFormat(<span style="color: #006080">&quot;{0}: {1}&quot;</span>, prop.Name.ToLower(), <span style="color: #006080">&quot;{&quot;</span>);
            rules.AppendLine();
            messages.AppendLine();

            <span style="color: #0000ff">for</span> (var i = 0; i &lt; generator.Rules.Count; i++)
            {
                var rule = generator.Rules[i];
                rules.AppendFormat(<span style="color: #006080">&quot;{0}&quot;</span>, rule.GetRuleString());
                messages.AppendFormat(<span style="color: #006080">&quot;{0}&quot;</span>, rule.GetMessageString());

                <span style="color: #0000ff">if</span> (i &lt; generator.Rules.Count - 1)
                {
                    rules.Append(<span style="color: #006080">&quot;,&quot;</span>);
                    messages.Append(<span style="color: #006080">&quot;,&quot;</span>);
                }
                <span style="color: #0000ff">else</span>
                {
                    rules.Append(<span style="color: #006080">&quot;}&quot;</span>);
                    messages.Append(<span style="color: #006080">&quot;}&quot;</span>);
                }
                rules.AppendLine();
                messages.AppendLine();
            }

            propCounter++;
        }
    }

    rules.Append(<span style="color: #006080">&quot;},&quot;</span>);
    messages.Append(<span style="color: #006080">&quot;}&quot;</span>);
    rules.AppendLine();
    messages.AppendLine();
    results.Append(rules.ToString());
    results.Append(messages.ToString());
    results.Append(<span style="color: #006080">&quot;});&quot;</span>);

    <span style="color: #0000ff">return</span> <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;&lt;script type='text/javascript'&gt;&lt;!--{1}{0}{1}--&gt;&lt;/script&gt;&quot;</span>,
                            results.ToString(), Environment.NewLine);
}</pre>
</div>
<h2>Changes</h2>
<p>Halfway through this post, I read Steve Sanderson&#8217;s <a href="http://blog.codeville.net/2008/09/08/thoughts-on-validation-in-aspnet-mvc-applications/" target="_blank">new post</a> and Stephen Walther&#8217;s <a href="http://weblogs.asp.net/stephenwalther/archive/2008/09/09/asp-net-mvc-application-building-forums-4-1-2-validation-revisited.aspx" target="_blank">new post</a> on validation, I made some changes to the code.&#160; I agree with their point that the controller shouldn&#8217;t be responsible for initiating the validation and it should be done at a lower layer.&#160; I refactored the code and my controller now looks like this</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">[AcceptVerbs(<span style="color: #006080">&quot;POST&quot;</span>)]
<span style="color: #0000ff">public</span> ActionResult Create(User user)
{
    <span style="color: #0000ff">try</span>
    {
        user = <span style="color: #0000ff">new</span> User();
        UpdateModel(user, <span style="color: #0000ff">new</span>[] { <span style="color: #006080">&quot;name&quot;</span>, <span style="color: #006080">&quot;email&quot;</span> });
        var service = <span style="color: #0000ff">new</span> UserService();
        service.Save(user);
    }
    <span style="color: #0000ff">catch</span> (RuleViolationException ex)
    {
        MvcValidator.PopulateModelStateWithErrors(user, ViewData.ModelState, ex);
    }
    <span style="color: #0000ff">return</span> View(user);
}</pre>
</div>
<p>&#160;</p>
<p>The validation gets initiated at the service (business logic) layer and if there is a rule violation an exception is thrown.&#160; I then take the exception and pass it to a helper method that populates the model state. Note: I could probably rewrite this so that the ModelState population happens before the exception throwing which will eliminate the call to the population method.</p>
<p>My view looks like this</p>
<pre class="csharpcode"><span class="asp">&lt;%</span>=Html.ValidationSummary() <span class="asp">%&gt;</span>
<span class="kwrd">&lt;</span><span class="html">form</span> <span class="attr">id</span><span class="kwrd">=&quot;formCreate&quot;</span> <span class="attr">name</span><span class="kwrd">=&quot;formCreate&quot;</span>
        <span class="attr">action</span><span class="kwrd">='&lt;%=Url.Action(&quot;Create&quot;)%&gt;'</span> <span class="attr">method</span><span class="kwrd">=&quot;post&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">label</span> <span class="attr">for</span><span class="kwrd">=&quot;name&quot;</span><span class="kwrd">&gt;</span>Name<span class="kwrd">&lt;/</span><span class="html">label</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">=&quot;text&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;name&quot;</span> <span class="attr">name</span><span class="kwrd">=&quot;name&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">label</span> <span class="attr">for</span><span class="kwrd">=&quot;email&quot;</span><span class="kwrd">&gt;</span>Email<span class="kwrd">&lt;/</span><span class="html">label</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">=&quot;text&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;email&quot;</span> <span class="attr">name</span><span class="kwrd">=&quot;email&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">br</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">=&quot;submit&quot;</span> <span class="attr">value</span><span class="kwrd">=&quot;Submit&quot;</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">form</span><span class="kwrd">&gt;</span>
<span class="asp">&lt;%</span>= Html.ClientSideValidation(<span class="str">&quot;formCreate&quot;</span>, ViewData.Model) <span class="asp">%&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Now if I try to submit the form, the client script validation runs and I get these errors</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/clip-image001.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="100" alt="clip_image001" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/clip-image001-thumb.png" width="382" border="0" /></a></p>
<p>If you get rid of client validation and only use server validation </p>
<p>to submit the form, the form would look like this</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/clip-image0014.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="121" alt="clip_image001[4]" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/clip-image0014-thumb.png" width="513" border="0" /></a></p>
<p>Finally, here is the client JavaScript generated in the view:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script type=<span style="color: #006080">'text/javascript'</span>&gt;&lt;!--
    $(<span style="color: #006080">&quot;#formCreate&quot;</span>).validate({
        rules: {
            name: {
                required: <span style="color: #0000ff">true</span>,
                minlength: <span style="color: #006080">&quot;3&quot;</span>,
                maxlength: <span style="color: #006080">&quot;25&quot;</span>
            },
            email: {
                email: <span style="color: #0000ff">true</span>,
                required: <span style="color: #0000ff">true</span>
            }
        },
        messages: {
            name: {
                required: <span style="color: #006080">&quot;Username is required&quot;</span>,
                minlength: <span style="color: #006080">&quot;Username should be between 3 and 25 characters long&quot;</span>,
                maxlength: <span style="color: #006080">&quot;Username should be between 3 and 25 characters long&quot;</span>
            },
            email: {
                email: <span style="color: #006080">&quot;Invalid email address&quot;</span>,
                required: <span style="color: #006080">&quot;Email is required&quot;</span>
            }
        }
    });
--&gt;&lt;/script&gt; </pre>
</div>
<p>&#160;</p>
<h2>Pros &amp; Cons</h2>
<p>Here is what I think the pros of this design are:</p>
<ol>
<li>I love using model attributes to define validation rules </li>
<li>I like that I only need 2 lines in my view </li>
<li>I like that I don&#8217;t have to do anything in the controller other than catch an exception and call a helper method </li>
</ol>
<p>The one thing I don&#8217;t like about this design is that it feels like there is a lot of dependencies.&#160; I might need to refactor the code and move things around.&#160; Here is my dependency diagram</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="505" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb3.png" width="417" border="0" /></a> </p>
<h2>Credit</h2>
<p>This code was possible because of other people&#8217;s work:</p>
<p>Stephen Walther &#8211; <a href="http://weblogs.asp.net/stephenwalther/archive/2008/09/09/asp-net-mvc-application-building-forums-4-1-2-validation-revisited.aspx" target="_blank">link</a></p>
<p>Steve Sanderson &#8211; <a href="http://blog.codeville.net/?p=86" target="_blank">link</a> and <a href="http://blog.codeville.net/2008/09/08/thoughts-on-validation-in-aspnet-mvc-applications/" target="_blank">link 2</a></p>
<p>Hamilton Verissimo &#8211; <a href="http://hammett.castleproject.org/?p=114">link</a></p>
<p>Rick Strahl &#8211; <a href="http://www.west-wind.com/weblog/posts/114530.aspx">link</a></p>
<p>Scott Guthrie &#8211; <a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx">link</a></p>
<h2>Source Code</h2>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/mvcvalidationexample.zip">Click here</a> to download the rough-quality source code.</p>
<p>Let me hear what you think of this design.&#160; What&#8217;s wrong with it?&#160; What&#8217;s right?&#160; <strong>Should I put this up on codeplex?</strong></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/05/resolving-url-in-aspnet-using-tilda/" rel="bookmark" title="Permanent Link: Resolving URL in ASP.net using Tilda (~)" >Resolving URL in ASP.net using Tilda (~)</a></span><div class="aizattos_related_posts_excerpt">I have been using .net since it has come out and I just found this out (so, I am kind of pissed).  W...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/11/aspnet-20-error-title-is-not-a-member-of-asp%e2%80%a6/" rel="bookmark" title="Permanent Link: asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…" >asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…</a></span><div class="aizattos_related_posts_excerpt">I had this error come up on a few pages after I deployed my website and it was driving me crazy.  Af...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/06/08/failed-to-generate-a-user-instance-of-sql-server-due-to-a-failure-in-starting-the-process-for-the-user-instance-the-connection-will-be-closed/" rel="bookmark" title="Permanent Link: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." >Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.</a></span><div class="aizattos_related_posts_excerpt">I had to uninstall and reinstall SQL server 2005 and Express on my development machine.  After the u...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/22/is-microsoft-buying-the-community/" rel="bookmark" title="Permanent Link: Is Microsoft Buying the Community?" >Is Microsoft Buying the Community?</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/" rel="bookmark" title="Permanent Link: Ajax with ASP.NET MVC Framework Preview 2" >Ajax with ASP.NET MVC Framework Preview 2</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/R5ON24aHHpMFDlLSRigBj1QL6GQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/R5ON24aHHpMFDlLSRigBj1QL6GQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/R5ON24aHHpMFDlLSRigBj1QL6GQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/R5ON24aHHpMFDlLSRigBj1QL6GQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/bwhnWxN--gw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/</feedburner:origLink></item>
		<item>
		<title>Deciding Between ASP.NET MVC and WebForms</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/zdoN5csA_zQ/</link>
		<comments>http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 20:21:26 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[aspnetmvc]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[MVC Book]]></category>
		<category><![CDATA[mvcbook]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[webforms]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/</guid>
		<description>I am trying to create a decision flowchart for my ASP.NET MVC book and wanted to get some community feedback.&amp;#160; Does this diagram make sense?&amp;#160; What other factors should one consider that should make it into the chart?
 
Things to Note
I have tried to use the general consensus of the community for each decision.&amp;#160; For [...]</description>
			<content:encoded><![CDATA[<p>I am trying to create a decision flowchart for my <a href="http://www.emadibrahim.com/category/mvc-book/" target="_blank">ASP.NET MVC book</a> and wanted to get some community feedback.&#160; Does this diagram make sense?&#160; What other factors should one consider that should make it into the chart?</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="894" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb2.png" width="519" border="0" /></a> </p>
<h2>Things to Note</h2>
<p>I have tried to use the general consensus of the community for each decision.&#160; For example, some might argue that MVC is better for prototyping but I would say the majority would disagree.</p>
<p>Keep in mind that these choices are not set in stone and are not mutually exclusive but are more like a guide to which platform would be better suited to satisfy a particular requirement.&#160; For example you might want to use TDD but still end up choosing on WebForms.&#160; (I should probably assign a weight to each question)</p>
<p>The &quot;No&quot; branch doesn&#8217;t mean exactly NO.&#160; I mean, answering No to &quot;Want cleaner HTML?&quot; doesn&#8217;t mean you have something against clean HTML or you want crappy HTML &#8211; no one wants that.&#160; Think of the question in terms of &quot;is clean html important to you?&quot;&#160; </p>
<p>Let me hear <strong>your feedback</strong> below and I will incorporate it in version of 2 of the diagram and post it back on the blog.&#160; Hopefully, this will help someone choose between ASP.NET MVC and WebForms on a new project.</p>
<p>Also, I don&#8217;t think a flowchart diagram is the best type of diagram for this type of decision tree.&#160; Can you suggest a <strong>better format</strong>?</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/" rel="bookmark" title="Permanent Link: Ajax with ASP.NET MVC Framework Preview 2" >Ajax with ASP.NET MVC Framework Preview 2</a></span><div class="aizattos_related_posts_excerpt">This is the updated version of the Nikhil's excellent example on how to use Ajax with ASP.net MVC.
...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/05/resolving-url-in-aspnet-using-tilda/" rel="bookmark" title="Permanent Link: Resolving URL in ASP.net using Tilda (~)" >Resolving URL in ASP.net using Tilda (~)</a></span><div class="aizattos_related_posts_excerpt">I have been using .net since it has come out and I just found this out (so, I am kind of pissed).  W...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/01/11/aspnet-20-error-title-is-not-a-member-of-asp%e2%80%a6/" rel="bookmark" title="Permanent Link: asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…" >asp.net 2.0 Error: &#8216;Title&#8217; is not a member of &#8216;ASP…</a></span><div class="aizattos_related_posts_excerpt">I had this error come up on a few pages after I deployed my website and it was driving me crazy.  Af...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/30/upgrading-yonkly-to-aspnet-mvc-preview-3/" rel="bookmark" title="Permanent Link: Upgrading Yonkly to ASP.NET MVC Preview 3" >Upgrading Yonkly to ASP.NET MVC Preview 3</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/22/is-microsoft-buying-the-community/" rel="bookmark" title="Permanent Link: Is Microsoft Buying the Community?" >Is Microsoft Buying the Community?</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/oWJwJil2Ewym3XLyyJSqM_HZF8Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/oWJwJil2Ewym3XLyyJSqM_HZF8Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oWJwJil2Ewym3XLyyJSqM_HZF8Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/oWJwJil2Ewym3XLyyJSqM_HZF8Y/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/zdoN5csA_zQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/</feedburner:origLink></item>
		<item>
		<title>Use ModelBinder to Generically Bind Complex Types</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/vrwcQU4Clqo/</link>
		<comments>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 17:53:28 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[mvcbook]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/</guid>
		<description>[Update: Simone brought my attention to the fact that ComplexModelBinder which comes with the framework does exactly that.&amp;#160; You can find more info here]
ASP.NET MVC Preview 5 introduce the ModelBinder attribute that can be used to decorate a complex type in an Action.&amp;#160; This allows us to have actions that look like this

public ActionResult Create([ModelBinder(typeof(GenericBinder))] [...]</description>
			<content:encoded><![CDATA[<p>[<strong>Update</strong>: Simone brought my attention to the fact that ComplexModelBinder which comes with the framework does exactly that.&nbsp; You can find more info <a href="http://weblogs.asp.net/scottgu/archive/2008/09/02/asp-net-mvc-preview-5-and-form-posting-scenarios.aspx" target="_blank">here</a>]</p>
<p>ASP.NET MVC Preview 5 introduce the ModelBinder attribute that can be used to decorate a complex type in an Action.&nbsp; This allows us to have actions that look like this</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> ActionResult Create([ModelBinder(<span style="color: #0000ff">typeof</span>(GenericBinder))] ContactList myList)</pre>
</div>
<p>&nbsp;</p>
<p>Instead of this:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> ActionResult Create(<span style="color: #0000ff">string</span> name, <span style="color: #0000ff">string</span> description)</pre>
</div>
<p>&nbsp;</p>
<p>The problem is that you have to build a Binder for every complex type you want to use as a parameter.&nbsp; For example, Maarten Balliauw created a model binder on his <a href="http://blog.maartenballiauw.be/post/2008/09/01/Using-the-ASPNET-MVC-ModelBinder-attribute.aspx" target="_blank">blog</a> and it looks like this:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ContactBinder : IModelBinder
{
    <span style="color: #cc6633">#region</span> IModelBinder Members
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> GetValue(ControllerContext controllerContext,
                 <span style="color: #0000ff">string</span> modelName, Type modelType,
                 ModelStateDictionary modelState)
    {
        <span style="color: #0000ff">if</span> (modelType == <span style="color: #0000ff">typeof</span>(Contact))
        {
            <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> Contact
            {
                Name = controllerContext.HttpContext.Request.Form[<span style="color: #006080">"name"</span>] ?? <span style="color: #006080">""</span>,
                Email = controllerContext.HttpContext.Request.Form[<span style="color: #006080">"email"</span>] ?? <span style="color: #006080">""</span>,
                Message = controllerContext.HttpContext.Request.Form[<span style="color: #006080">"message"</span>] ?? <span style="color: #006080">""</span>
            };
        }
        <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;
    }
    <span style="color: #cc6633">#endregion</span>
}</pre>
</div>
<p>&nbsp;</p>
<p>Now that is a lot of typing and because I am lazy, I decided to create a generic binder that uses reflection and can work with all my complex types.&nbsp; </p>
<p><strong>Note</strong>: By generic I mean common &#8211; it has nothing to do with .net Generics</p>
<p>Also note that this will <strong>only</strong> work if you follow these conventions:</p>
<ol>
<li>The html field name must match the property name
<li>User lower case names for the html fields
<li>You don&#8217;t have to user lower case on your model properties</li>
</ol>
<p>Here is the very rough and untested Generic Binder:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">class</span> GenericBinder : IModelBinder
{
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> GetValue(ControllerContext controllerContext,
                            <span style="color: #0000ff">string</span> modelName, Type modelType,
                            ModelStateDictionary modelState)
    {
        var instance = Activator.CreateInstance(modelType);
        <span style="color: #0000ff">foreach</span> (var prop <span style="color: #0000ff">in</span> modelType.GetProperties())
        {
            prop.SetValue(instance,
                    controllerContext.HttpContext.Request
                                    .Form[prop.Name.ToLower()],
                    <span style="color: #0000ff">null</span>);
        }
        <span style="color: #0000ff">return</span> instance;
    }
}</pre>
</div>
<p>&nbsp;</p>
<p>If you find any bugs or have a better implementation, please share.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/27/mocking-and-dependency-injection-in-aspnet-mvc/" rel="bookmark" title="Permanent Link: Mocking and Dependency Injection in ASP.NET MVC" >Mocking and Dependency Injection in ASP.NET MVC</a></span><div class="aizattos_related_posts_excerpt">Here is the situation, my controller constructors take multiple interfaces as parameters.&nbsp; I do...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/21/ninject-killer-ioc/" rel="bookmark" title="Permanent Link: Ninject: Killer IoC" >Ninject: Killer IoC</a></span><div class="aizattos_related_posts_excerpt">In my previous post, The Best IoC Container, I decided to go with StructureMap as the framework of c...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/04/26/getting-flash-video-flv-to-work-in-iis/" rel="bookmark" title="Permanent Link: Getting Flash Video (FLV) to work in IIS" >Getting Flash Video (FLV) to work in IIS</a></span><div class="aizattos_related_posts_excerpt">I added a macromedia flash animation (swf) to my asp.net website and it would work fine but when it ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/20/ultimate-file-synchronization/" rel="bookmark" title="Permanent Link: Ultimate file synchronization between multiple computers" >Ultimate file synchronization between multiple computers</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/12/dynamically-build-linq-queries-using-reflection/" rel="bookmark" title="Permanent Link: Dynamically Build LINQ Queries Using Reflection" >Dynamically Build LINQ Queries Using Reflection</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/uOh6TGIjQjID5W9vL7OKuzqBo6E/0/da"><img src="http://feedads.g.doubleclick.net/~a/uOh6TGIjQjID5W9vL7OKuzqBo6E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/uOh6TGIjQjID5W9vL7OKuzqBo6E/1/da"><img src="http://feedads.g.doubleclick.net/~a/uOh6TGIjQjID5W9vL7OKuzqBo6E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/vrwcQU4Clqo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/09/03/use-modelbinder-to-generically-bind-complex-types/</feedburner:origLink></item>
		<item>
		<title>Google Chrome JavaScript Speed Test</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/YRg02gTru04/</link>
		<comments>http://www.emadibrahim.com/2008/09/02/google-chrome-javascript-speed-test/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 19:37:15 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/google-chrome-javascript-speed-test/</guid>
		<description>Google&amp;#8217;s new browser &amp;#8211; Chrome &amp;#8211; has a JavaScript engine called V8 that was built from scratch.&amp;#160; So, how fast is it?
I ran these tests http://mootools.net/slickspeed/ on IE, Firefox and Chrome.
Here are the results: 

It looks like Chrome is about 13% faster than Firefox and 82% faster than IE 7.
All browsers are running on the [...]</description>
			<content:encoded><![CDATA[<p>Google&#8217;s new browser &#8211; Chrome &#8211; has a JavaScript engine called V8 that was built from scratch.&nbsp; So, how fast is it?</p>
<p>I ran these tests <a href="http://mootools.net/slickspeed/">http://mootools.net/slickspeed/</a> on IE, Firefox and Chrome.</p>
<p>Here are the results: </p>
<p><iframe style="width: 513px; height: 493px" src="http://spreadsheets.google.com/pub?key=pWDFUiSiQCCMIP-aay__NYQ&amp;hl=en"></iframe></p>
<p>It looks like Chrome is about 13% faster than Firefox and 82% faster than IE 7.</p>
<p>All browsers are running on the same computer, so the hardware/os settings are irrelevant.&nbsp; But if you are curious, it&#8217;s a Windows Vista 64-bit machine with 6 Gigs of RAM and a quad core chip.</p>
<p><strong>[Update] If you are reading this in Chrome, the embedded document is broken.&nbsp; I guess Google didn&#8217;t test there own sites.&nbsp; It should look like this:</strong></p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="429" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb.png" width="461" border="0"></a> </p>
<p>Instead it looks like this:</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/09/image1.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="444" alt="image" src="http://www.emadibrahim.com/wp-content/uploads/2008/09/image-thumb1.png" width="460" border="0"></a></p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/21/google-reader-hacks/" rel="bookmark" title="Permanent Link: Google Reader Hacks" >Google Reader Hacks</a></span><div class="aizattos_related_posts_excerpt"> Here is a pretty comprehensive list of Google Reader hacks...
For those who want more out of Google...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/02/10/help-debugging-ajax-and-javascript/" rel="bookmark" title="Permanent Link: Help debugging AJAX and JavaScript" >Help debugging AJAX and JavaScript</a></span><div class="aizattos_related_posts_excerpt">As you all know, there is really no easy way to debug AJAX and JavaScript applications, but I found ...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/07/25/sitemeter-and-wordpress/" rel="bookmark" title="Permanent Link: Sitemeter and wordpress" >Sitemeter and wordpress</a></span><div class="aizattos_related_posts_excerpt">I just added sitemeter to BlogsToGo (WordPres Mu).  I have a plugins file in my mu-plugins directory...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/02/10/validating-the-page-using-javascript/" rel="bookmark" title="Permanent Link: Validating the page using JavaScript" >Validating the page using JavaScript</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2007/09/11/microsoft-money-plus-2008-review/" rel="bookmark" title="Permanent Link: Microsoft Money Plus (2008) Review (Part 1)" >Microsoft Money Plus (2008) Review (Part 1)</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/YLKAJjC0DQl2WZTnyGf5oJJKGXo/0/da"><img src="http://feedads.g.doubleclick.net/~a/YLKAJjC0DQl2WZTnyGf5oJJKGXo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YLKAJjC0DQl2WZTnyGf5oJJKGXo/1/da"><img src="http://feedads.g.doubleclick.net/~a/YLKAJjC0DQl2WZTnyGf5oJJKGXo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/YRg02gTru04" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/09/02/google-chrome-javascript-speed-test/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/09/02/google-chrome-javascript-speed-test/</feedburner:origLink></item>
		<item>
		<title>Is this Better than Constructor Injection?</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/LWCK2q3lGAI/</link>
		<comments>http://www.emadibrahim.com/2008/08/29/is-this-better-than-constructor-injection/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 22:02:21 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[di]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[MVC Book]]></category>
		<category><![CDATA[mvcbook]]></category>
		<category><![CDATA[ninject]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/08/28/is-this-better-than-constructor-injection/</guid>
		<description>So after I finished my post on property injection I thought of something, maybe I shouldn&amp;#8217;t use constructor injection for my classes.&amp;#160; Maybe, I can just use lazy properties that would call my IoC (Ninject) Kernel to instantiate the object.&amp;#160; So instead of defining a constructor like this:

public IAccountService Service { get; set; }

[Inject]
public AccountController(IAccountService [...]</description>
			<content:encoded><![CDATA[<p>So after I finished <a href="http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/" target="_blank">my post on property injection</a> I thought of something, maybe I shouldn&#8217;t use constructor injection for my classes.&nbsp; Maybe, I can just use lazy properties that would call my IoC (Ninject) Kernel to instantiate the object.&nbsp; So instead of defining a constructor like this:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> IAccountService Service { get; set; }

[Inject]
<span style="color: #0000ff">public</span> AccountController(IAccountService service)
{
    Service = service;
}</pre>
</div>
<p>I could just have a property Service do the work like this:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">public</span> IAccountService Service
{
    get
    {
        <span style="color: #0000ff">return</span> (IAccountService) Kernel.Get(<span style="color: #0000ff">typeof</span> (IAccountService));
    }
}</pre>
</div>
<p>If I get rid of all my constructor parameters then I won&#8217;t need to change my ControllerFactory to use the Ninject Factory.&nbsp; This keeps looking better and better.</p>
<p>What do you think?&nbsp; I keep reading everywhere that construction injection is the way to go.&nbsp; But why complicate my constructor when I can have the properties do the heavy lifting?&nbsp; I would love to hear what you think.</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/" rel="bookmark" title="Permanent Link: Ajax with ASP.NET MVC Framework Preview 2" >Ajax with ASP.NET MVC Framework Preview 2</a></span><div class="aizattos_related_posts_excerpt">This is the updated version of the Nikhil's excellent example on how to use Ajax with ASP.net MVC.
...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/" rel="bookmark" title="Permanent Link: Property Injection in ASP.NET MVC with Ninject" >Property Injection in ASP.NET MVC with Ninject</a></span><div class="aizattos_related_posts_excerpt">I got a design challenge with asp.net mvc.  I want to keep track of the currently logged in user in...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/18/the-best-ioc-container/" rel="bookmark" title="Permanent Link: The Best IoC Container?" >The Best IoC Container?</a></span><div class="aizattos_related_posts_excerpt">As I previously mentioned in my post "The Best JavaScript Library", I am in the process of developin...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/27/mocking-and-dependency-injection-in-aspnet-mvc/" rel="bookmark" title="Permanent Link: Mocking and Dependency Injection in ASP.NET MVC" >Mocking and Dependency Injection in ASP.NET MVC</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/7SHjMKIfUu1GNto_0t88_xsM8H8/0/da"><img src="http://feedads.g.doubleclick.net/~a/7SHjMKIfUu1GNto_0t88_xsM8H8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7SHjMKIfUu1GNto_0t88_xsM8H8/1/da"><img src="http://feedads.g.doubleclick.net/~a/7SHjMKIfUu1GNto_0t88_xsM8H8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/LWCK2q3lGAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/08/29/is-this-better-than-constructor-injection/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/08/29/is-this-better-than-constructor-injection/</feedburner:origLink></item>
		<item>
		<title>Property Injection in ASP.NET MVC with Ninject</title>
		<link>http://feedproxy.google.com/~r/EmadIbrahim/~3/NVuwalCG2Gw/</link>
		<comments>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 12:01:41 +0000</pubDate>
		<dc:creator>Emad Ibrahim</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[di]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[MVC Book]]></category>
		<category><![CDATA[mvcbook]]></category>
		<category><![CDATA[ninject]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/</guid>
		<description>I got a design challenge with asp.net mvc.  I want to keep track of the currently logged in user in the session because I don&amp;#8217;t want to hit the database every time I need to get the username or id for a query.  And I have all my controllers inherit from a base controller named [...]</description>
			<content:encoded><![CDATA[<p>I got a design challenge with asp.net mvc.  I want to keep track of the currently logged in user in the session because I don&#8217;t want to hit the database every time I need to get the username or id for a query.  And I have all my controllers inherit from a base controller named BaseController.  So, I added a CurrentUser property to the BaseController and I want it to automagically work without the derived controllers having to do anything.  Here is a class diagram to help clarify:</p>
<p><a href="http://www.emadibrahim.com/wp-content/uploads/2008/08/image2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://www.emadibrahim.com/wp-content/uploads/2008/08/image-thumb2.png" border="0" alt="image" width="487" height="314" /></a></p>
<p>The CurrentUser Property needs to look something like this:</p>
<div>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #0000ff;">public</span> User CurrentUser
{
    get
    {
        var key = <span style="color: #006080;">"currentuser"</span>;
        <span style="color: #0000ff;">if</span> (Session[key] == <span style="color: #0000ff;">null</span>)
        {
            Session[key] = <span style="color: #008000;">/*get user from database some how*/</span>;
        }
        <span style="color: #0000ff;">return</span> (User) Session[key] ;
    }
}</pre>
</div>
<p>This looks simple enough but it is not.  The reason it is not simple is because to get the current user I have to call Membership.Provider.GetUser from the BaseController.  The problem with that is that it creates a dependency on the MembershipProvider class which I don&#8217;t want to have, because it will make testing very hard.</p>
<p>One obvious solution was to add the MembershipProvider (which is an abstract class) to the BaseController&#8217;s construct and then pass a mocked instance during testing&#8230;  The problem with this design is that now my BaseController will be forced to have a parameterized constructor which means that I have to change the code in all the derived controllers to handle that and pass the appropriate instance of MembershipProvider.  Sounds like a code smell.</p>
<p>My solution was to create the MembershipProvider class using my IoC container &#8211; in this case, my Ninject Kernel.  This allows me to inject a SqlMembershipProvider in development and runtime and inject a mocked provider in testing.  So the final CurrentUser property looks like this:</p>
<div>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #0000ff;">public</span> User CurrentUser
{
    get
    {
        var key = <span style="color: #006080;">"currentuser"</span>;
        <span style="color: #0000ff;">if</span> (Session[key] == <span style="color: #0000ff;">null</span>)
        {
            var Provider
                = (MembershipProvider)
                    Kernel.Get(<span style="color: #0000ff;">typeof</span>(MembershipProvider));

            Session[key] = AppHelper.CreateUserFromMembershipUser
                            (Provider.GetUser(User.Identity.Name, <span style="color: #0000ff;">true</span>));
        }
        <span style="color: #0000ff;">return</span> (User) Session[key] ;
    }
}</pre>
</div>
<p>If you have been paying attention, you are probably wondering  what is this &#8220;Kernel&#8221; thing.  Well Kernel is an instance of the Ninject Kernel which itself was injected into the BaseController class like this:</p>
<div>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">[Inject]
<span style="color: #0000ff;">public</span> IKernel Kernel { get; set; }</pre>
</div>
<p>I could have done this differently.  For example, I could have injected the provider itself using property injection like this:</p>
<div>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">[Inject]
<span style="color: #0000ff;">public</span> MembershipProvider Provider { get; set; }</pre>
</div>
<p>The only problem is that the provider isn&#8217;t needed by all the derived classed and I didn&#8217;t want to have a public property in the base class that would hardly be used anywhere else.   On the other hand Kernel could be globally used to instantiate an object.</p>
<p>What do you think?  Is this the way to do it?  Is there a better way?</p>
<div class="aizattos_related_posts"><span class="aizattos_related_posts_header" >Related Posts</span><ul><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/29/is-this-better-than-constructor-injection/" rel="bookmark" title="Permanent Link: Is this Better than Constructor Injection?" >Is this Better than Constructor Injection?</a></span><div class="aizattos_related_posts_excerpt">So after I finished my post on property injection I thought of something, maybe I shouldn't use cons...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/05/30/upgrading-yonkly-to-aspnet-mvc-preview-3/" rel="bookmark" title="Permanent Link: Upgrading Yonkly to ASP.NET MVC Preview 3" >Upgrading Yonkly to ASP.NET MVC Preview 3</a></span><div class="aizattos_related_posts_excerpt">I just spent this morning upgrading the Yonkly code to work with the newly released ASP.NET MVC Fram...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/08/18/the-best-ioc-container/" rel="bookmark" title="Permanent Link: The Best IoC Container?" >The Best IoC Container?</a></span><div class="aizattos_related_posts_excerpt">As I previously mentioned in my post "The Best JavaScript Library", I am in the process of developin...</div></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/" rel="bookmark" title="Permanent Link: Ajax with ASP.NET MVC Framework Preview 2" >Ajax with ASP.NET MVC Framework Preview 2</a></span></li><li><span class="aizattos_related_posts_title"><a href="http://www.emadibrahim.com/2008/09/07/deciding-between-aspnet-mvc-and-webforms/" rel="bookmark" title="Permanent Link: Deciding Between ASP.NET MVC and WebForms" >Deciding Between ASP.NET MVC and WebForms</a></span></li></ul></div>
<p><a href="http://feedads.g.doubleclick.net/~a/TGL1wgNfq6ymFY8pNLglOyzsm4M/0/da"><img src="http://feedads.g.doubleclick.net/~a/TGL1wgNfq6ymFY8pNLglOyzsm4M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TGL1wgNfq6ymFY8pNLglOyzsm4M/1/da"><img src="http://feedads.g.doubleclick.net/~a/TGL1wgNfq6ymFY8pNLglOyzsm4M/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/EmadIbrahim/~4/NVuwalCG2Gw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 2.530 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-07-12 02:32:32 -->
