Ajax Portal using VS 2008 and .NET 3.5

I have built an Ajax Web Portal (just like Sharepoint or Google
IG) using Linq to SQL, Linq to XML, Workflow Foundation and ASP.NET
AJAX 3.5. Although it’s no where close to any real Portal, but it
works as a great example to show how web applications can implement
a widget enabled architecture just like Sharepoint. It also
showcases how these hot technologies can play together in a
complete web application.


Full source code is in Visual Studio 2008 using .NET 3.0 and
.NET 3.5.

CodePlex site

Production site

Code Project article that explains the architecture and
development steps



  • ASP.NET 3.5
  • ASP.NET AJAX (.NET 3.5)
  • Linq to Sql
  • Linq to Xml
  • Workflow Foundation (.NET 3.0)
  • Visual Studio 2008 and SQL Server 2005

Technology Stack


What is an AJAX Portal
A portal refers to a page that allows users to customize their own
homepage by dragging and dropping widgets onto the page.
This approach gives users complete control over what content they
see on their Start Page, where they want to see it, and how they
want to interact with it.
A widget is a discrete piece on a Web page that performs a
particular function and comes with its own UI and set of features.
Examples of widgets include a to-do-list, an address book, a
contact list, an RSS feed, or even a clock, calendar, playlist,
stock ticker, weather report, traffic report, dictionary, game, or
almost anything you can imagine that can be packaged up and dropped
on a Web page. In a corporate environment, widgets can connect to
internal systems, such as an Expense Tracker widget that interacts
directly with the internal Accounting System. If you are familiar
with Sharepoint Portal, then you already know about Widgets. They
are called Web parts in Sharepoint’s term and also in ASP.NET
Portals are powerful RSS aggregation platform. You can put as many
RSS widgets as you like on your page and get fresh content
delivered to you as soon as it is published.
An Ajax-powered portal is specifically a portal that uses Ajax
technologies to create richer experiences for its users. It is one
step ahead of previous generation portals like My Yahoo or MSN.com,
because it gives you state-of-the-art UI that behaves more like a
Windows client application — with widgets, animations, popups,
client side data grids, and other effects not usually found on a
non-Ajax Web portal.

How to run the project

  1. Install Visual Studio 2008 (VS 2005 won’t work)
  2. Install SQL Server 2005
  3. Download latest code from CodePlex site.
  4. Restore the database from databasedashboard.zip
  5. Update web.config from the web project and set proper
    connection string
  6. Build and Run

How is ASP.NET AJAX used in this project?
It is an N-tier application, with a user interface (UI) layer, a
business layer, and a data access layer. I have used ASP.NET AJAX
to implement the UI layer of the portal application which includes
the homepage and the widgets’ UI. ASP.NET AJAX provides the
framework for loading widgets onto the Start page, updating widgets
without doing any postbacks (via UpdatePanel), and changing
page layout by dragging and dropping widgets on the page. It also
provides a rich collection of Control Extenders, that add cool
effects like fade in/fade out, smooth transitions, and client side
animations . You can add to the rich client-side experience by
providing auto-completion behavior on text boxes, asynchronous data
loading via webservice calls, and client-side paging, sorting and
many more.

How is .NET 3.5 used in this project
The business layer of the application is built with the Workflow
Foundation in .NET 3.0 . Major operations like a first-time user
visit, a subsequent user visit, adding a new widget, and creating a
new page are all orchestrated using workflow . The workflows
contain all the business rules and activities needed to complete
each operation. For example, the “New User Visit” workflow creates
the user account, populates the user profile with default values,
creates some default pages, populates them with specific widgets,
etc. Such compound operations are very easy to build with Workflows
, which enables you to break the complete workflow operation into
smaller chunks named Activities. Each Activity does a very small
amount of work. It talks to the data access layer and performs the
task. The data access layer is built with .NET 3.5 , utilizing LINQ
to SQL .
The web project and the widgets make good use of .NET 3.5 by
utilizing lambda expressions , LINQ to SQL, and LINQ to XML. You
will use Linq queries to work with collections and database rows.
Widgets make good use of Linq to Xml in order to consume XML from
external data sources.


The above figure shows an workflow that creates the default
homepage for a new user.

You are invited to participate in continued development of the
project. If you want to develop widgets, you can download the code,
develop the widget offline and then send me the widget related
files. I will put them up on the production site. If you want to
participate in core development, let me know and I will make you a
developer on the codeplex project. Then you can check out code,
work on it and then check in when you are done.

Warning: Dropthings.com is a very simple, open-source example of
what can be done with AJAX and Microsoft technologies. It is
intended for educational purposes only. Dropthings.com has
absolutely nothing to do with pageflakes.com, and has no code or
technology in common. Trust me, you could not possibly build
a product as advanced, scalable and complex as Pageflakes using the
examples here, and you’d be insane to try 🙂 But this
project does a good job to show you how all these technologies work
together in a working web application.

20 thoughts on “Ajax Portal using VS 2008 and .NET 3.5”

  1. wow.. another great development.. i’ve been watching the developments of this project for some time. Only now i noticed you have a new version…

    I havent played with the new code yet.. but im really amazed on how you managed to load the widget one at a time.. same as pageflakes.. which was not handled by the last version of dropthings…

    Anyway, just a few and minor error.. still when i drag the top most widget (1st row) to the 2nd position, same column, then refresh page, position is not saved. but it works when you drag the 2nd widget to the topmost (1st row, same column)… then refresh…

    great job omar…

  2. I am not sure why did you choose UpdatePanel for the Ajax operation? Certainly, it gives RAD supports for the developers but suffers in high volume Ajax site like StartPage. The biggest drawback of Update Panel is unlike the WebService/PageMethods it does not allow multiple concurrent executions. Once you made second partial update request when the first one is still in progress, it aborts the first one and start executing the second. I have shown how to serialized the calls of Update Panel that you will find in this post geekswithblogs.net/…/Asp.net-Ajax-UpdatePanel-Simultaneous-Update—A-Remedy.aspx but surly serializing the call does not fit in the startpage environment.

  3. Restoring data base with SQL Server 2005 Management Studio express works or no? I do not have full MS SQL Server 2005. I have one which comes with VS 2008. Also, I downloaded SQL Server 2005 Management Studio express.

  4. Hi, I managed a .NET 3.5 host but the problem is that I dont have ORCAS yet installed and I guess its quite a long trouble…can I get a compiled version of dropthings.com so that I can directly upload it to host? Thanks a lot for your cooperation.

  5. Just adding to my previous post, can anyone else who is using this code, provide me the compiled version of this application so that I can simply upload it on the host? Would really appreciate anyone’s help. Thanks

  6. Hi, I have even tried running the code with Visual Studio Express Edition 2008 Web Developer and for C# but the DashboardBusiness project is not running properly. I would again request you people if anyone can give me a compiled version of the project. Thanks a lot.

  7. Hi everyone,

    For all of you getting a compile error on the Business class. Between beta2 and RTM of .NET 3.5, the following commands have changed:

    * Add –> InsertOnSubmit

    * AddAll –> InsertAllOnSubmit

    * Remove –> DeleteOnSubmit

    * RemoveAll –> DeleteAllOnSubmit

    So, change all Add’s to InsertOnSubmit, and Remove’s to the corresponding command and you’ll see that the project compiles fine.

    Great job Omar. Very cool.

  8. HI Omar

    Love your work.

    Having a problem with Update in Linq when moving the widgets from one place to another.

    I know Linq has changed and the Update function now requires a concurrency check.

    Any ideas on a fix for this?

    Happens in the same place as the InsertOnSubmit changes.



  9. Hi,

    With the post of TJ Tansu, I finally compile the code with VS2008.

    However I get an error when I drag an item.

    Here’s the message.

    An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported.

    And here the line where this happens.

    File : databasehelper.cs

    Line : 30 – db.GetTable().Attach(obj);

    Any help ?

  10. congrats mishu. love your very clear descriptions and diagrams, we at somewhere in… adore you, you are an ocean of knowledge and wisdom. wishing you a happy married life and a great 2008. happy new year.

  11. Hey,

    i wan to call Ajax asp.net web service from client script,

    but the web service is not working,

    i m tired and fed up.

    can any1 help me in getting out of this hell.

  12. I could not use dropthings.bak file. When i tried to restore this file it gives error “RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3219)”. Can you help me to restore this file in SQL Server 2005.

  13. Hi Omar,

    My question is about retaining the position of the widgets i.e. when i drag/drop a widget from one block to other and do a page refresh; how can i keep the widget at the last location on which it was dropped??

  14. “I could not use dropthings.bak file. When i tried to restore this file it gives error “RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3219)”. Can you help me to restore this file in SQL Server 2005.”

    You have to put “dropthings.bak” in the backup sqlserver backup folder ex:”C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackup”

    I dont know why, but its work for me only if I do this!

  15. Hi Mehdi Atmani,

    “You have to put “dropthings.bak” in the backup sqlserver backup folder ex:”C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackup”

    I tried this also.It gives error “System.Data.SqlClient.SqlError:Directory lookup for file “G:DatabasesDashboard.mdf” failed with operating system error3″ .I don't have G: drive also.

    Can you post your mdf and ldf file if possible for the database.

  16. They are lot less AJAXy and lot more postbacky, that’s why.

    Moreover, they are delivering the site from a server in your garage. You never knew 😉

    They use content delivery network and powerful servers. Mine runs on a poor Virtual Server.

Leave a Reply