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.

DropThingsScreenshot

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

CodePlex site
http://www.codeplex.com/dropthings

Production site
http://www.dropthings.com

Code Project article that explains the architecture and development steps
http://www.codeproject.com/Ajax/MakingGoogleIG.asp

Technologies

  • 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

TechnologyStack

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 2.0.
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 database\dashboard.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.

NewUserVisitWorkflow

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.

Published Sun, Oct 14 2007 14:02 by omar
Filed under:

Comments

# re: Ajax Start Page using VS 2008 and .NET 3.5

Monday, October 15, 2007 8:10 AM by James

I think this is a great start page and would love to use it, however most hosting companies do not offer .net 3.5, is there a version of .net 2.0.

# re: Ajax Start Page using VS 2008 and .NET 3.5

Monday, October 15, 2007 9:00 AM by omar

In my codeproject article's forum, someone posted a link to a .net 2.0 version.

I will welcome anyone's contribution to convert the project to .net 2.0.

# re: Ajax Start Page using VS 2008 and .NET 3.5

Tuesday, October 16, 2007 12:56 AM by Tahmid Munaz

Great post! Linking it at my Blog

# re: Ajax Portal using VS 2008 and .NET 3.5

Thursday, October 25, 2007 9:53 PM by Korn

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...

# re: Ajax Portal using VS 2008 and .NET 3.5

Thursday, October 25, 2007 9:59 PM by Kazi Manzur Rashid

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, October 26, 2007 2:40 PM by kpatel

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Monday, October 29, 2007 5:49 AM by Salman

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Monday, October 29, 2007 5:54 AM by Salman

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

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, November 02, 2007 2:32 AM by Salman

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, November 23, 2007 10:58 AM by TJ Tansu

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Tuesday, November 27, 2007 3:16 PM by Martin

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.

Thanks

mtrevena@reeds.net.au

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, December 07, 2007 6:17 AM by Stan

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<T>().Attach(obj);

Any help ?

# re: Ajax Portal using VS 2008 and .NET 3.5

Sunday, December 09, 2007 3:45 AM by omar

Please download the latest code. I have uploaded VS 2008 RTM compatible version yesterday.

# re: Ajax Portal using VS 2008 and .NET 3.5

Wednesday, January 02, 2008 3:55 PM by mike kidder

Hi Omar,

Do you foresee this app being updated to utilize the latest 3.5 extensions, in particular, MVC?

# re: Ajax Portal using VS 2008 and .NET 3.5

Saturday, January 05, 2008 4:32 AM by arild

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Monday, March 24, 2008 1:44 PM by khurram shairyar -pakistan - NUST

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Wednesday, April 16, 2008 10:08 PM by Adron

btw - Great job, excellent project!

# re: Ajax Portal using VS 2008 and .NET 3.5

Monday, April 21, 2008 8:14 AM by Hemant

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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Thursday, April 24, 2008 5:22 AM by Surjit Singh Dadhwal

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??

# re: Ajax Portal using VS 2008 and .NET 3.5

Tuesday, April 29, 2008 12:31 PM by Mehdi Atmani

"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 Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"

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

# re: Ajax Portal using VS 2008 and .NET 3.5

Wednesday, May 07, 2008 8:25 AM by Hemant

Hi Mehdi Atmani,

 "You have to put "dropthings.bak" in the backup sqlserver backup folder ex:"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"

  I tried this also.It gives error "System.Data.SqlClient.SqlError:Directory lookup for file "G:\Databases\Dashboard.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.

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, May 09, 2008 8:28 AM by Robson

Great, but is not as fast as iGoogle. Why?

# re: Ajax Portal using VS 2008 and .NET 3.5

Friday, May 09, 2008 9:04 AM by omar

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 Comment

(required) 
(required) 
(optional)
(required)