<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Beckham</title><subtitle type="html" /><id>http://spellcoder.com/blogs/beckham/atom.aspx</id><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/default.aspx" /><link rel="self" type="application/atom+xml" href="http://spellcoder.com/blogs/beckham/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2008-03-14T08:36:00Z</updated><entry><title>JavaScript - Flash Communication </title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2009/08/29/24326.aspx" /><id>http://spellcoder.com/blogs/beckham/archive/2009/08/29/24326.aspx</id><published>2009-08-29T11:28:00Z</published><updated>2009-08-29T11:28:00Z</updated><content type="html">I used to work with flash all the times, in fact we used it in almost every project through college. You can do amazing things with flash very easily and honestly I love action script&lt;img src="/emoticons/emotion-2.gif" alt="Big Smile [:D]" /&gt;.
Whenever you work with flash you will find yourself need to make flash communicate with other applications. &lt;br&gt;&amp;nbsp;In action script you can communicate with a host application (in my case the Browser) 
through &lt;a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html"&gt;External Interface&lt;/a&gt;. &lt;br&gt;&lt;br&gt;&lt;b&gt;To do that you to write a little JavaScript Code:&lt;/b&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;First you need to get the name of the flash movie and as usual this name differs along with the browser you are using so here is a method that I found here to get you the name of the flash movie whatever the browser is:


&lt;pre class="csharpcode"&gt;&lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; &lt;/font&gt;getFlashMovieObject(movieName) {&lt;br&gt;    &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; &lt;/font&gt;(window.document[movieName]) {&lt;br&gt;             &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;/font&gt;window.document[movieName];&lt;br&gt;        }&lt;br&gt;    &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; &lt;/font&gt;(navigator.appName.indexOf(&lt;font color="#800080"&gt;&lt;span class="str"&gt;"Microsoft Internet"&lt;/span&gt;&lt;/font&gt;) == -1) {&lt;br&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (document.embeds &amp;amp;&amp;amp; document.embeds[movieName])&lt;br&gt;                    &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;/font&gt;document.embeds[movieName];&lt;br&gt;            }&lt;br&gt;    &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;/font&gt;&lt;font color="#008000"&gt;// &lt;span class="kwrd"&gt;if&lt;/span&gt; (navigator.appName.indexOf(&lt;span class="str"&gt;"Microsoft Internet"&lt;/span&gt;)!=-1)&lt;/font&gt;&lt;br&gt;            {&lt;br&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; document.getElementById(movieName);&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;&lt;font color="#008000"&gt;// Now Call the function on your flash movie.&lt;/font&gt;&lt;br&gt;&lt;br&gt;      &lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; &lt;/font&gt;SendDataToFlashMovie(data) {&lt;br&gt;       &lt;font color="#0000ff"&gt;var &lt;/font&gt;flashMovie = getFlashMovieObject(&lt;font color="#800080"&gt;&lt;span class="str"&gt;"myFlashMovie"&lt;/span&gt;&lt;/font&gt;);&lt;br&gt;       flashMovie.&lt;font color="#0000ff"&gt;JStoAS&lt;/font&gt;(data);}&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;then you have to write alittel Action Script code:&lt;/b&gt;&lt;br&gt;Now you have to register a callback method to respond to your method call from javascript.&lt;br&gt;&lt;br&gt;&lt;pre class="csharpcode"&gt;&lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;import flash.external.ExternalInterface;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;br&gt;ExternalInterface.addCallback&lt;/span&gt;&lt;/font&gt;(&lt;font color="#800080"&gt;&lt;span class="str"&gt;"JStoAS"&lt;/span&gt;&lt;/font&gt;, getDataFromJavaScript);&lt;br&gt;&lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; &lt;/font&gt;getDataFromJavaScript(data:&lt;font color="#0000ff"&gt;&lt;span class="kwrd"&gt;String&lt;/span&gt;&lt;/font&gt;):&lt;font color="#0000ff"&gt;void &lt;/font&gt;{&lt;br&gt;&lt;font color="#008000"&gt;// Dod whatever you want &lt;span class="kwrd"&gt;with&lt;/span&gt; data here&lt;/font&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;and that's how it's done &lt;img src="/emoticons/emotion-5.gif" alt="Wink [;)]" /&gt;&lt;br&gt;&lt;br&gt;&lt;font color="#000000"&gt;&lt;b&gt;Beckham&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=24326" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Print support for Facebox and lightbox v1.0</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2009/06/09/23581.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="320469" href="http://spellcoder.com/blogs/beckham/attachment/23581.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2009/06/09/23581.aspx</id><published>2009-06-10T01:07:00Z</published><updated>2009-06-10T01:07:00Z</updated><content type="html">&lt;br&gt;
Hey, Its been a long time :) i was pretty busy in some work :( along with preparing to come back to Egypt for a small vacation isA .&lt;br&gt;&lt;br&gt;Anyway, you all know&amp;nbsp; &lt;a href="http://famspam.com/facebox"&gt;facebox &lt;/a&gt;and &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;Lightbox&lt;/a&gt;. I wanted to allow the user to print the content of the &lt;a href="http://famspam.com/facebox"&gt;facebox &lt;/a&gt;and &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;lightbox &lt;/a&gt;and sadly this wasn't available in &lt;a href="http://famspam.com/facebox"&gt;facebox &lt;/a&gt;and &lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;lightbox &lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;v1.0&lt;/a&gt; but it's available in &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;lightbox&lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt; v2.0&lt;/a&gt; but sadly i did some modification to my &lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;lightbox &lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;v1.0 &lt;/a&gt;file and i really was to lazy to redo it in &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;lightbox &lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;v2.0&lt;/a&gt; :).&lt;br&gt;anyway attached is the &lt;a href="http://famspam.com/facebox"&gt;facebox &lt;/a&gt;and &lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;lightbox &lt;/a&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox/"&gt;v1.0&lt;/a&gt; with print support.&lt;br&gt;&lt;br&gt;the final output will be like that &lt;br&gt;

&lt;img src="http://img25.imageshack.us/img25/7927/facebox.jpg" alt="facebox"&gt;
&lt;br&gt;
&lt;img src="http://img26.imageshack.us/img26/4982/lightboxg.jpg" alt="lightbox"&gt;
&lt;br&gt;
&lt;br&gt;
Beckham
&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=23581" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Why go Facebook when you can Outlook</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/12/16/17875.aspx" /><link rel="enclosure" type="application/zip" length="1215595" href="http://spellcoder.com/blogs/beckham/attachment/17875.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/12/16/17875.aspx</id><published>2008-12-16T19:32:00Z</published><updated>2008-12-16T19:32:00Z</updated><content type="html">&lt;div&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;span&gt;Facebook
to outlook &lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;First,
Facebook as a very successful social networking website already contains a lot
of information that we need and that will save us a lot of work not only to get
this information but to use it as well.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Second,
as you already know, we all work in the morning sometimes we don’t have time to
turn around and certainly don’t have time to open up a browser window and
typing the Facebook URL and start logging in, it seems a lot of time which
sometimes we don’t have. But yet we would like to update our personal status on
Facebook. So how can I do that without wasting all that time?!&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;The
solution is pretty easy, we all have outlook opened up since the very first
second you boot up your computer at work as all work related mails comes
through outlook, so why don’t we make it a bit funny and use it to update our
status.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;span&gt;The
“Facebook to Outlook” plug-in consists of two main features&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;a.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Friends to
Contacts.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;b.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Update my status.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;c.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Send notification
messages.&lt;/span&gt;&lt;/p&gt;

&lt;br&gt;
&lt;img src="http://img155.imageshack.us/img155/5295/menuke8.jpg" alt=""&gt;
&lt;br&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;&lt;span&gt;So in this post I’m
gonna walkthrough how to make the first plug-in as the rest is pretty much the
same. Okay, let’s go&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;span&gt;Friends
to Contacts:&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;As
a Facebook user I have a lot of friends on Facebook and those friends already
published their information and I would like to have those friends in my outlook
contact list. So instead of writing down the information of my Facebook friends
I just thought it will be nice to have a button that I can click and it does
all the work of getting my friends information and adding them to my outlook
contact list.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;The
bad thing is the Facebook REST services don’t allow you to get the email
address of friends but I guess it’s better to just modify an existing friend
and add the email instead of adding the entire contact information.&lt;/span&gt;&lt;/p&gt;



&lt;h3&gt;&lt;span&gt;Getting friend’s information from Facebook.&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;span&gt;To get started developing applications with the Facebook API,
you first need to register your application and get an API key from Facebook
which will allow you to connect to their site and download data. Their &lt;a href="http://developers.facebook.com/get_started.php"&gt;Get Started&lt;/a&gt; page will
lead you through the process. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Now that you have an API key, you can start developing. While
you can connect to Facebook and get the information manually through HTTP REST
calls, &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Okay we first need to get the list of facebook friends:&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img519.imageshack.us/img519/523/loadfriendslu3.jpg" alt=""&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img353.imageshack.us/img353/1227/eventsls9.jpg" alt=""&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img176.imageshack.us/img176/7585/intializeservicesma0.jpg" alt=""&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Next, we bind the friends list &lt;/span&gt;&lt;b&gt;&lt;span&gt;FriendSelected&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span&gt; &lt;/span&gt;&lt;/b&gt;&lt;span&gt;event, to
allow the user to select his friends he wishes to add as outlook friends&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img141.imageshack.us/img141/7854/friendsselectedee8.jpg" alt=""&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img353.imageshack.us/img353/3742/friendstocontactszn2.jpg" alt=""&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Next,
we add some code to the &lt;/span&gt;&lt;b&gt;&lt;span&gt;SelectedIndexChanged&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span&gt; &lt;/span&gt;&lt;/b&gt;&lt;span&gt;list to
allow a user to remove a friend he already selected.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://img156.imageshack.us/img156/1056/selectedindexchangedcf9.jpg" alt=""&gt;&lt;/span&gt;&lt;/p&gt;



&lt;p&gt;&lt;span&gt;Finally,
we write the code to move the facebook friends to our outlook contacts.&lt;/span&gt;&lt;/p&gt;



&lt;p&gt;&lt;img src="http://img390.imageshack.us/img390/7924/addtocontactstu5.png" alt=""&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img141.imageshack.us/img141/4201/addtomycontacts1gd1.jpg" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img266.imageshack.us/img266/3522/addtomycontacts2st5.jpg" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img519.imageshack.us/img519/6875/jobinfoyb8.jpg" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img519.imageshack.us/img519/8339/hobbyya1.jpg" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img360.imageshack.us/img360/8058/addgenderel4.jpg" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img119.imageshack.us/img119/1644/addimagenk4.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;and the final output is&lt;/p&gt;
&lt;img src="http://img168.imageshack.us/img168/1457/donesp0.jpg" alt=""&gt;

&lt;p&gt;&lt;br&gt;Beckham&lt;br&gt;&lt;/p&gt;

&lt;/div&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=17875" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>JQuery Magic Continues --&amp;gt; Enable Searching and sorting in GridView at the client side.</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/11/16/17348.aspx" /><link rel="enclosure" type="application/zip" length="326970" href="http://spellcoder.com/blogs/beckham/attachment/17348.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/11/16/17348.aspx</id><published>2008-11-16T20:24:00Z</published><updated>2008-11-16T20:24:00Z</updated><content type="html">I geuss you heared about JQuery, Which is an amazing JavaScript library that makes it easy to create wonderful web effects in just a few lines of code. As the website says:&lt;br /&gt;

“jQuery is a JavaScript library that takes this motto to heart: Writing JavaScript code should be fun. jQuery achieves this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.”
&lt;br /&gt;
there are a lot of jQuery plugins such as facebox. &lt;br /&gt;
there is also a 2 plugins that are very cute and neat:&lt;br /&gt;
1- The Table Sorter Plugin&lt;br /&gt;
2- The table search plugin.
&lt;br /&gt;&lt;br /&gt;
today i'm gonna use these plugins to allow sorting and searching for the grid view control at the client side ( No Postback)
&lt;br /&gt;
okay, Let's start,
&lt;br /&gt;
first of all you need to download the&lt;a href="http://docs.jquery.com/"&gt; jQuery&lt;/a&gt;, &lt;a href="http://rikrikrik.com/jquery/quicksearch/"&gt;Quick Search&lt;/a&gt; &amp;amp; &lt;a href="http://tablesorter.com/docs/"&gt;Table Sorter&lt;/a&gt; plugins.
&lt;br /&gt;&lt;br /&gt;
1- Create a webpage and put in a GridView control.&lt;br&gt;
2- bind your gridview to a data source. in my case i'll use a SQL Data source, that connects to the northwind db and get some information from the [Customers] table.
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img394.imageshack.us/img394/1446/grdpv2.jpg" alt="gridAndDataSource"&gt;
&lt;br /&gt;&lt;br /&gt;
3- Now the cool part to enable the search into the grid view just add this nice piece of js code
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img58.imageshack.us/img58/4792/searchxm1.jpg" alt="quicksearch"&gt;
&lt;br /&gt;&lt;br /&gt;
just make sure to add the js files that you downloaded
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img58.imageshack.us/img58/338/refcc2.jpg" alt="refrences"&gt;    
&lt;br /&gt; &lt;br /&gt;       
4- To enable sorting is a bit tricky as the table sorter plugin is working with the standard HTML table with  and  tags  but the grid view renders only  without  tag.
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img87.imageshack.us/img87/5466/tbodyonlytv2.jpg" alt="nothead"&gt;
&lt;br /&gt;&lt;br /&gt;
Okaay, how can we make the gridview renders the  tag ??? We can do that by this line of code which tells the grid view to render the header row as  tag.
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img204.imageshack.us/img204/2650/theadut6.jpg" alt="addthead"&gt;
&lt;br /&gt;&lt;br /&gt;
Now to make your grid sortable at the client side just add this line
&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://img394.imageshack.us/img394/9848/sortvi3.jpg" alt="sortable"&gt;
&lt;br /&gt;
&lt;br /&gt;
now you can search and sort your grid at the client.
&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://img55.imageshack.us/img55/3458/finalda7.jpg" alt="finalgrid"&gt;
&lt;br&gt;
&lt;br&gt;
Beckham&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=17348" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>PLINQO: Professional LINQ to Objects</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/07/07/14480.aspx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/07/07/14480.aspx</id><published>2008-07-07T17:07:00Z</published><updated>2008-07-07T17:07:00Z</updated><content type="html">


&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;font face="Times New Roman" size="4"&gt;&lt;u&gt;&lt;b&gt;PLINQO&lt;/b&gt;&lt;/u&gt;, &lt;/font&gt;which stands for Professional LINQ to Objects, is a
collection of &lt;a href="http://www.codesmithtools.com/"&gt;Code Smith&lt;/a&gt; templates that are meant to replace and extend the
LINQ to SQL designers that are included with Visual Studio 2008.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h1&gt;&lt;font size="2"&gt;&lt;span&gt;For more information about PLINQO
Check out &lt;a href="http://community.codesmithtools.com/blogs/pwelter/"&gt;Paul welter's&lt;/a&gt; post &lt;a href="http://community.codesmithtools.com/blogs/pwelter/archive/2007/08/08/plinqo.aspx"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/font&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h1&gt;

Beckham&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=14480" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Funny bug in ASP.NET MVC While creating a new project</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/06/06/14188.aspx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/06/06/14188.aspx</id><published>2008-06-06T14:36:00Z</published><updated>2008-06-06T14:36:00Z</updated><content type="html">While i was playing with ASP.NET MVC CTP3 i met this funny bug while creating a new MVC project in visual studio 2008: &lt;BR&gt;&lt;BR&gt;1- Create a new mvc project and choose to have a test project. &lt;BR&gt;&lt;BR&gt;2- In the project name put "-". &lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://img260.imageshack.us/img260/5576/newprojectva8.png"&gt; &lt;BR&gt;&lt;BR&gt;3- Hit ok, The project will be created succefully, That's great but try to build. &lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://img133.imageshack.us/img133/8917/nobuilddz9.png"&gt; &lt;BR&gt;&lt;BR&gt;Apperantly the "-" has been replaced With "_" in the namespace name but the odd thing they didn't use the right name in the test project :) &lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://img133.imageshack.us/img133/2803/replacingdashwithundersvv4.png"&gt; &lt;BR&gt;&lt;BR&gt;&lt;B&gt;And here is the bug:&lt;/B&gt; &lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://img210.imageshack.us/img210/5106/thebugwz6.png"&gt; &lt;BR&gt;&lt;BR&gt;Beckham &lt;img src="http://spellcoder.com/aggbug.aspx?PostID=14188" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Wrap ContinuousText Inside Label</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/04/11/11916.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="4570" href="http://spellcoder.com/blogs/beckham/attachment/11916.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/04/11/11916.aspx</id><published>2008-04-11T15:37:00Z</published><updated>2008-04-11T15:37:00Z</updated><content type="html">&lt;P&gt;Hey guys, I was wondering if any of you has the situation of displaying a text in a label?? sure you&amp;nbsp;did. but imagine the text is tooooo long that it's displayed in a long line, Now if you put it in the label it will be displayed in a long line too, to solve this problem there is a lot of solutions you will find if you &lt;A href="http://www.google.com.eg/search?sourceid=navclient&amp;amp;ie=UTF-8&amp;amp;rlz=1T4AMSA_enEG259EG259&amp;amp;q=wrap+text+inside+label"&gt;google it&lt;/A&gt;. you can use a textbox and give it the look of&amp;nbsp;a label and set the wrap property to true this will do the trick. but what if you have a devil user or actually&amp;nbsp;" QE Teammate ", and the text he entered is continuous as it was one word in this case it will not be wrapped. so here is a littel extension string helper&amp;nbsp;method that warps the string into lines of length given as a parameter.&lt;BR&gt;The idea here is to devide the string&amp;nbsp;into lines and put a line break tag at the end of the line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;IMG src="http://img142.imageshack.us/img142/3077/wrapextensionmethodhy2.jpg"&gt; 
&lt;P&gt;Ofcourse it has some drawback such as the last word of the line might be splitted.but you can put "-" or something like this at the end of the line.&lt;/P&gt;
&lt;P&gt;Hope this is helpfu, The source code is attached.&lt;/P&gt;
&lt;P&gt;Beckham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=11916" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Coding4Fun</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/04/06/11405.aspx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/04/06/11405.aspx</id><published>2008-04-06T18:26:00Z</published><updated>2008-04-06T18:26:00Z</updated><content type="html">&lt;p class="EC_MsoNormal"&gt;Hey guys, In this post I wanted to share something very cool with 
you guys, It’s &lt;a href="http://www.microsoft.com/express/samples/C4FDevKit/"&gt;Coding4Fun Developer Toolkit&lt;/a&gt; part of the &lt;a href="http://blogs.msdn.com/coding4fun/"&gt;coding4Fun&lt;/a&gt; Community.&lt;br&gt; &lt;/p&gt;
&lt;p class="EC_MsoNormal"&gt;A very cool toolkit that allows you to do a lot of stuff 
that was very very very difficult before, you can do it now very easily.&lt;/p&gt;
&lt;p class="EC_MsoNormal"&gt;Here is a link to some of the really cool posts that I really loved:&lt;/p&gt;
&lt;p class="EC_MsoNormal"&gt;The first link is dedicated for the fans or &lt;a href="http://en.wikipedia.org/wiki/Rock_Band_%28video_game%29"&gt;Rock Band&lt;/a&gt; Game 
everywhere and specifically&amp;nbsp; &lt;a href="http://www.silverkeytech.com/"&gt;“Silver Key”&lt;/a&gt; folks,&amp;nbsp; 
Check out &lt;a href="http://blogs.msdn.com/coding4fun/archive/2008/03/19/8172578.aspx"&gt;this&lt;/a&gt;.&lt;/p&gt;What about foosball, it's like the best game ever, Agree ?? check &lt;a href="http://blogs.msdn.com/coding4fun/archive/2006/10/31/910302.aspx"&gt;this&lt;/a&gt; out.&lt;br&gt;


&lt;p class="EC_MsoNormal"&gt;Have you ever thought that you already have a lot of friends on your facebook account and it would be nice to add these contacts to 
your phone, If you did check out &lt;a href="http://blogs.msdn.com/coding4fun/archive/2007/12/28/6893024.aspx"&gt;this one&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;
&lt;p class="EC_MsoNormal"&gt;Okay, Now for the fans of working with two monitors, would 
you like to set different desktop image to each monitor, If you do check out &lt;a href="http://blogs.msdn.com/coding4fun/archive/2007/10/02/5246528.aspx"&gt;this one.&lt;/a&gt;&lt;/p&gt;

&lt;p class="EC_MsoNormal"&gt;For ASP.Net &amp;nbsp;Fans check out this new &lt;span&gt;&lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=305671"&gt;WhoIsLooking&lt;/a&gt; ASP.NET 
Control. &lt;br&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="EC_MsoNormal"&gt;For more tutorial and samples and other very cool apps check out the &lt;a href="http://blogs.msdn.com/coding4fun/"&gt;Coding4Fun&lt;/a&gt; 
Site.&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;Beckham&lt;br&gt;&lt;/p&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=11405" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>Sorting a Grid View That's bounded to IEnumerable</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/03/22/9900.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="28046" href="http://spellcoder.com/blogs/beckham/attachment/9900.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/03/22/9900.aspx</id><published>2008-03-22T16:39:00Z</published><updated>2008-03-22T16:39:00Z</updated><content type="html">Have you ever had a grid view that's bounded to an IEnumerable collection? Yes.&lt;BR&gt;Very well have you ever wanted to enable sorting to this grid view? Yeah, what's the big deal?&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&lt;STRONG&gt;Okay, here is the deal:- &lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;Grid view enable automatic sorting that allows you to sort you data in the grid view without writing any code but sadly this automatic sorting is enabled only for Grid View that's bounded to a DataSourceControl (i.e. SqlDataSource, ObjectDataSource).&lt;BR&gt;You can't do that with grid view that's bounded to an IEnumerable collection, why? &lt;BR&gt;Because actually the grid view uses the DataSourceControl to sort the data for it.&lt;BR&gt;&lt;BR&gt;&amp;nbsp;So how can I sort my gridview that's bounded to a IEnumerable collection? You can reconstruct your collection as a table and then pass that table to a data view and sort these data using that data view sorting and then bind your grid view to the data view like that :-&amp;gt; &lt;BR&gt;&lt;BR&gt;
&lt;IMG src="http://img213.imageshack.us/img213/4987/customerlistandclassvp6.jpg"&gt;&lt;BR&gt;&lt;BR&gt;This is the defenition of our customer class that will be used to fill our collection. &lt;BR&gt;Notic: The serializable attribute only so we can save our list of cutomers to the ViewState. &lt;BR&gt;&lt;BR&gt;
&lt;IMG src="http://img329.imageshack.us/img329/3405/sortexpressionanddirectaj3.png"&gt;&lt;BR&gt;&lt;BR&gt;We will need to keep track of our current sort expression and direction so we can use it later in resorting the list. &lt;BR&gt;&lt;BR&gt;
&lt;IMG src="http://img170.imageshack.us/img170/5742/pageloaduz4.jpg"&gt;
&lt;P&gt;&lt;BR&gt;&lt;BR&gt;Her we fill our list of customers with some dummy data. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;IMG src="http://img329.imageshack.us/img329/5357/sortdirectionmethodhi3.jpg"&gt;&lt;BR&gt;&lt;BR&gt;Change the sort direction from Ascending to Descending and vice versa. &lt;BR&gt;&lt;BR&gt;
&lt;IMG src="http://img172.imageshack.us/img172/7820/sortingeventhandlerwk1.jpg"&gt;
&lt;P&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Look at our Sorting event handler see how much code we wrote to get this done. Is this the only way to do that ?? Noooo, we can do that very easily using LINQ without creating a table or a data view. &lt;BR&gt;&lt;BR&gt;&lt;SPAN class=style1&gt;&lt;STRONG&gt;&lt;FONT size=4&gt;LINQ To The Rescue:-&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR&gt;See all that code we wrote to create a table and fill the table with data and then creating the creating the data view, well we don't need all of that. &lt;BR&gt;We will use the Order by extension method to sort our IEnumerable collection. &lt;BR&gt;ex: - &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;IMG src="http://img179.imageshack.us/img179/6472/sortnglistnk0.jpg"&gt;
&lt;P&gt;&lt;BR&gt;&lt;BR&gt;Well that's great and everything but dude you hard coded the sort expression "customer.Id" what will I do if the user clicks on the Name column? Well you can continue hard coding and write an order by statement for each column you have and select the appropriate statement using switch case based on the user's selections.&lt;BR&gt;&amp;nbsp;Dude that's horrible I don't like hard coding, Is there anyway else like passing the property name as a variable? Well, No you can't pass the property name as a variable but yes there is another way,&amp;nbsp; You can use reflection to get the property name dynamically ;) &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;IMG src="http://img510.imageshack.us/img510/6309/sortnglistusingreflectiwn8.jpg"&gt;&lt;BR&gt;&lt;BR&gt;Here is our Sorting event handler after using Orderby and reflection :- &lt;BR&gt;&lt;BR&gt;
&lt;IMG src="http://img329.imageshack.us/img329/9833/sortinghandlerafterreflja3.jpg"&gt;&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Beckham&lt;/STRONG&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=9900" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>ASP.NET MVC Preview 2 </title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/03/15/9813.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="175740" href="http://spellcoder.com/blogs/beckham/attachment/9813.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/03/15/9813.aspx</id><published>2008-03-16T02:12:00Z</published><updated>2008-03-16T02:12:00Z</updated><content type="html">&lt;H2&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;FONT size=4&gt;ASP.NET MVC Preview 2 is released and you can download it from &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=38CC4CF1-773A-47E1-8125-BA3369BF54A3&amp;amp;displaylang=en"&gt;here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;In this CTP, A lot of changes happened in the MVC framework such as:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;1-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; W&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;hen you define a controller action method you don't have to put the &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;SPAN&gt;ControllerAction&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; all you have to do is to define the method as public and it will be part of the contract, Okay but what if I wanted to define a non action method, well now you have to put an attribute &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;SPAN&gt;NonAction&lt;/SPAN&gt;]. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;2-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Another thing is the {*catchall} The new * which allows you pass anything from the * to the end of the URL as a parameter for the action. And this is actually what I'm going to talk about in this post. But you can find a lot of stuff about the ASP.NET MVC Framework Preview 2 in &lt;A href="http://www.hanselman.com/blog/"&gt;Scott Hanselman&lt;/A&gt; Videos &lt;A href="http://asp.net/mvc/"&gt;here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;In my &lt;A HREF="/blogs/beckham/archive/2008/03/14/9807.aspx"&gt;previous post &lt;/A&gt;I bloged about ASP.NET MVC &amp;amp; JQuery,&lt;/SPAN&gt;&lt;SPAN&gt; I was calling an action method which takes as a parameter the name of the category (In the Northwind database) to get the products for that category.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;Well, the thing is some of the categories name contains "/" which as you already know is used in the URL, so it didn't work. I overcome this issue by using Query String to pass in the parameter to the action method like that:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; url = &lt;SPAN&gt;'/Products/GetProducts?category='&lt;/SPAN&gt;+ categoryName;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN&gt;But now with the new &lt;/SPAN&gt;&lt;SPAN&gt;{*catchall}&lt;/SPAN&gt;&lt;SPAN&gt; route rule it can be done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;routes.Add(&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;Route&lt;/SPAN&gt;( &lt;SPAN&gt;"Products/GetProducts/&amp;nbsp;{*category}"&lt;/SPAN&gt;,&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;MvcRouteHandler&lt;/SPAN&gt;())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Defaults = &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;RouteValueDictionary&lt;/SPAN&gt; (&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;controller = &lt;SPAN&gt;"Products"&lt;/SPAN&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;action = &lt;SPAN&gt;"GetProducts"&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}),&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;});&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;As you can see I used the {*category} not {*catchall} so catchall is not a keyword the * is the important part. But the important thing is whatever name you put after the {*} you must use the same name for the action method parameter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;For example, in the previous snippet I used: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"Products/GetProducts/{*category}&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;So in my Get Products action method I must pass in a category parameter like that:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN&gt;void&lt;/SPAN&gt; GetProducts(&lt;SPAN&gt;string&lt;/SPAN&gt; category)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;The full source is attached.&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;P.S: To convert an MVC Application from Preview 1 to Preview 2 there is a lot of stuff and I mean "a lot" that you will have to change to get your application up and running and most of the changes will not be in your code. So if your application is a small one my advice is that create &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;a new application and just copy &amp;amp; paste your code in to it and now the changes that you will have to make is in your code &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;J&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN&gt;But if your application big and hard to just copy &amp;amp; paste just follow the steps the &lt;/SPAN&gt;release notes &lt;A href="http://www.asp.net/downloads/3.5-extensions/readme/Preview2.aspx"&gt;here&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Times New Roman"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;STRONG&gt;&lt;FONT face="Times New Roman"&gt;Beckham&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal dir=ltr&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=9813" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry><entry><title>ASP.Net MVC &amp;amp; JQuery Magic</title><link rel="alternate" type="text/html" href="http://spellcoder.com/blogs/beckham/archive/2008/03/14/9807.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="56540" href="http://spellcoder.com/blogs/beckham/attachment/9807.ashx" /><id>http://spellcoder.com/blogs/beckham/archive/2008/03/14/9807.aspx</id><published>2008-03-14T15:36:00Z</published><updated>2008-03-14T15:36:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Before we talk about JQuery and ASP.Net MVC let's take an overview about both of them.&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;Here we go,&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;1-&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;What is MVC Framework? &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&amp;nbsp; Model View Controller Model is a design pattern that allows separation of concerns. As the framework consists of 3 components:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;IMG title=MVC height=173 alt=MVC src="http://img265.imageshack.us/img265/6352/mvcyg8.jpg"&gt;&lt;/P&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;a.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN&gt;Model:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt; .is the component responsible for maintaining data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;b.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN&gt;View:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt; is the component responsible for displaying the user interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;c.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B&gt;&lt;SPAN&gt;Controller&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;: is the component responsible for handling all the user interaction and all the manipulation of the model and passing the data to the view to display it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;For more information there is a lot of resources out &lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;&lt;A href="http://www.google.com/search?hl=en&amp;amp;q=model%20view%20controller"&gt;&lt;SPAN&gt;there&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://www.google.com/search?hl=en&amp;amp;q=model%20view%20controller"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT size=3&gt;&lt;STRONG&gt;2- &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What is ASP.Net MVC?&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ASP.Net now supports the MVC Framework, as part of the CTP Preview &lt;/SPAN&gt;&lt;SPAN&gt;of an "ASP.NET 3.5 Extensions"&lt;/SPAN&gt;&lt;SPAN&gt; for more information about what's in that extension refer to&amp;nbsp; &lt;A href="http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-3-5-extensions-ctp-preview-released.aspx"&gt;Scott Gu's blog&lt;/A&gt; .&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;In ASP.Net MVC the controller handles all the interaction with user collects the information and manipulates the model data and then renders the appropriate view. So it allows a great deal of separation of concerns and it makes it a lot easier to test your application without even building the user interface. And it also gives you the control over the URL in a neat way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;For more information about ASP.Net MVC &lt;A href="http://weblogs.asp.net/scottgu/default.aspx"&gt;Scott Gu&lt;/A&gt; has made a pretty cool series of tutorial in his blog, Check it out &lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://weblogs.asp.net/scottgu/archive/2008/02/12/asp-net-mvc-framework-road-map-update.aspx"&gt;&lt;SPAN&gt;here&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;3- &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What is JQuery? &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;jQuery is an amazing JavaScript library that makes it easy to create wonderful web effects in just a few lines of code. As the website says:”&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;“jQuery is a JavaScript library that takes this motto to heart: Writing JavaScript code should be fun. jQuery achieves this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.” &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT size=3&gt;&lt;STRONG&gt;4- How JQuery works with Asp.net MVC???&lt;BR&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Okay, as you already know there is no post back in ASP.Net MVC. And so there is no server controls &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;J&lt;/SPAN&gt; What about ASP.NET AJAX UpdatePanels? &lt;A href="http://weblogs.asp.net/scottgu/default.aspx"&gt;Scott Gu&lt;/A&gt;&amp;nbsp;mentions this in his comments: &lt;BR&gt;UpdatePanel does use post back, so you won't use that control directly within a MVC based view. &amp;nbsp;But there will be a control (and optional helper method) with capabilities very similar to it. &amp;nbsp;It will invoke an action on a controller and allow you to incrementally update a portion of HTML really easily. &amp;nbsp;It will enable you to use the ASP.NET AJAX libraries really easily.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Well why don't we try to do that with Jquery and ASP.Net MVC .,&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Okay lets start by downloading&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://asp.net/downloads/3.5-extensions/"&gt;&lt;SPAN&gt; CTP Preview &lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://asp.net/downloads/3.5-extensions/"&gt;of an "ASP.NET 3.5 Extensions"&lt;/A&gt;&lt;BR&gt;And the latest&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://jquery.com/"&gt;&lt;SPAN&gt; JQuery&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, In this tutorial I'll be using the northwind database you can download it from &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;amp;displaylang=en"&gt;here&lt;/A&gt;,&amp;nbsp;Now let's try to create an update panel with jquery.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;STRONG&gt;Okay so here is what we want to do:&lt;o:p&gt;&lt;/o:p&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;1- List all the categories in the categories table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;2- When we click on any category we want to go to the server and bring back all the products inside that category without post back ofcourse.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;So let's see how we can do that,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;1- After you installed the CTP Preview, Create a new project and you will have a new project type called "ASP.NET MVC Web Application" Choose it and name the project "MVCJQueryMagic".&lt;/SPAN&gt; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title="MVC Project" alt="MVC Project" src="http://img139.imageshack.us/img139/4713/mvcprojectes4.jpg"&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp; &lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;2- Now let's add our model, Right Click the model folder and add a new item and choose "Linq To SQL", and then we will use the server explorer and drag the categories &amp;amp; Products tables and the ORM designer will infer the relations between the tables. And name it "Northwind.dbml".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;IMG title="New Item - Linq2Sql" alt=MVC src="http://img265.imageshack.us/img265/5540/newitemlinq2sqlwk6.jpg"&gt;&lt;BR&gt;
&lt;IMG title=ORM alt=MVC src="http://img265.imageshack.us/img265/305/ormci8.jpg"&gt; &lt;BR&gt;&lt;BR&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;- Now after creating our model as we all know our controller is the only thing that is allowed to manipulate the model's data and it's good practice and recommended that you keep your controller code short, So now we will create some helper methods in our "DataContext" that was created by our ORM Designer that will help us in both keeping our controller code short and in retrieving data from our model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;SPAN&gt;&lt;BR&gt;a- First create a partial class and name it "NorthwindDataContext":&lt;/SPAN&gt; &lt;BR&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img139.imageshack.us/img139/9900/partialdatacontextclasshe5.jpg"&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN&gt;b- We will create two methods the first one to get all the categories from the categories table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;SPAN&gt;The second one will take a category id as a parameter and return a list of products for that category.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN&gt;In this code I use LINQ to retrieve a list of categories in the "GetCategories" method and used lambda expressions in the "GetProducts" method to get a list of products for a specific category.&lt;/SPAN&gt;
&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img265.imageshack.us/img265/1457/partialdatacontextclasstc8.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;In this code I use LINQ to retrieve a list of categories in the "GetCategories" method and used lambda expressions in the "GetProducts" method to get a list of products for a specific category.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;At this point we are done with our model. Let's move on to the controller.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;1- Right Click On the controller folder and add a new item and choose "MVC Controller" and name it "ProductsController".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;IMG title=controller alt="MVC " src="http://img404.imageshack.us/img404/2706/controllerhirarchykp8.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;2- In our case we will have two action methods the first one is to handles the requests asking for the categories, and the second one is to handle our AJAX request to get all products for a specific category.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img404.imageshack.us/img404/2972/productscontrollerui0.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;In the previous screen&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt;:&lt;BR&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;All I do here is using our helper methods to get the data required to call our Renderview Method. I also created a class named "ProductsViewData" to send the list of products along with the category's name. For more information about passing view data to views refer to &lt;A href="http://weblogs.asp.net/scottgu/default.aspx"&gt;Scott Gu's&lt;/A&gt; Blog &lt;A href="http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx"&gt;here&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;SPAN&gt;Now, Our UI is ready to be created, let's dig in.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;If you looked at the controller class you will see that we need to create two views but again if you remember at first we said that what we are going to do is a page with a list of categories and once you click any category all the products inside that category will appear in the same page " AJAX Call ", That's a little bit confusing, Isn't it?!!!!&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Well nooooo, it's not. Here is what's going to happen:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;1-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Our Ajax call will call an action method "GetProducts" asking it to get all the products for the category specified by the id. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;2-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;The "GetProducts" Action method will get the products data and pass it to the view responsible for rendering these data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;3-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Then it passes the rendered page back as a response for our Ajax call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;4-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;We then take this page and by using JQuery we can attach it to our Category List Page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;So if you think about it the second view is considered &lt;B&gt;a partial view&lt;/B&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;BR&gt;&lt;BR&gt;&lt;B&gt;&lt;SPAN&gt;Now let's create our views:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;1-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Let's create our "Products" Folder inside our Views Folder (That's the default place which the mvc framework will be looking for the views in the products controller).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img139.imageshack.us/img139/3735/productsfoldersc8.jpg"&gt;
&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;2-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Let's add our partial view, Right Click on the "Products" folder that we just created and add new item and choose "MVC View Page" and name it "Partial_Products".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img265.imageshack.us/img265/7277/partialproductscreatefh4.jpg"&gt;
&amp;nbsp;

&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;3-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Remove everything from the page and leave the page tag only because as we mentioned this is a partial view page all it does is rendering the products list.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;4-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Add this code to the page.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img404.imageshack.us/img404/3114/partialproductscodezq5.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;This code first writes the Category name as a title and then creates an unordered list with the products for that category.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;Now lets move on to the fun part, creating the view which will contain our Ajax call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;1- &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Let's add our view, Right Click on the "Products" folder that we just created and add new item and choose "MVC View Content Page" just use our master page (you can create a "MVC View Page " without using the master page it's up to you)and name it "CategoriesView".&lt;/SPAN&gt; &lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img139.imageshack.us/img139/3848/categoriesviewcreategt5.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;2- Let's create the code to render our list of categories as links which when clicked will invoke a java script function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img260.imageshack.us/img260/1653/categoriesviewcodera4.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;At the bottom in the previous screen:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt; &lt;BR&gt;we've created an empty div and set its display to none to be invisible, we will be using this div to show our products retrieved from the Ajax call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;3- Now let's write our java script function which will make the ajax call to the server to get our products back and make sure you have included the jQuery Library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img139.imageshack.us/img139/9559/ajaxcallbackmethodqs3.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;In the above screen: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;1-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;We created a function with the same name that we call from our links.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;2-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; productsContainer = $(&lt;SPAN&gt;"#divProducts"&lt;/SPAN&gt;); &lt;BR&gt;we get a refrence to our div we created earlier using &lt;BR&gt;JQuery Syntax ( $ -&amp;gt; is shortcut for "jQuery" and # is used to select element by id).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;3-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; url = &lt;SPAN&gt;'/Products/GetProducts?category='&lt;/SPAN&gt;+ categoryName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Here I compose the url to which we are going to make our ajax call to get our products.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;4- &lt;/SPAN&gt;&lt;SPAN&gt;$.&lt;SPAN&gt;get&lt;/SPAN&gt;(url,&lt;SPAN&gt;function&lt;/SPAN&gt;(data)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;BR&gt;productsContainer.fadeIn(&lt;SPAN&gt;'slow'&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;productsContainer.html(data);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;})&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;The ($.get ) JQuery syntax is used to make a jax call to the server and as you can see it takes to parameter &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;1-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;The url that it's going to make the call to&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;2-&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;The function to pass the data returned from the call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;In the function we show the div (the fadIn() function does a littel fad in animation just to give a good look) and set the inner html of our empty div to display the returned data from the server.&lt;BR&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;SPAN&gt;For our final step&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN&gt; to let the mvc framework where to go when our generated url is requested we need to define &lt;st1:address&gt;A Route&lt;/st1:address&gt; in the "Global.asax" File.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;BR&gt;
&lt;IMG title=PartialDataContextClass alt=MVC src="http://img139.imageshack.us/img139/4137/routefc9.jpg"&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Well that's it we have our update panel up and &amp;nbsp;working. You can download the source code from attachment.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;P.S: an updated version with MVC Preview 2 available&lt;A HREF="/blogs/beckham/archive/2008/03/15/9813.aspx"&gt; here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Beckham&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://spellcoder.com/aggbug.aspx?PostID=9807" width="1" height="1"&gt;</content><author><name>beckham</name><uri>http://spellcoder.com/members/beckham.aspx</uri></author></entry></feed>