Here is an ASP.NET MVC 3 sample web site to let ASP.NET MVC learners see how a real application is developed and works. This will be the first version of the app so more versions are lined up to emerge.
This ASP.NET MVC application is intended to be as simple as possible so you have to know that it is not such a comprehensive commercial application. The database, user interface and code snippets are tend to be concise and clear. Next versions will cover the utilization of Ajax and Asp.NET MVC UI controls.
What is this application about?
WebAdvert is an online advertisement web site. Basically users can sign up and issue their own adverts. They also will be able to manage (view/edit/delete) the ads. Anonymous users can browse the existing ads. Finally, administrators can view/create/delete the members and also assign them to the “Admins” role if necessary.
WebAdvert uses ASP.NET Forms authentication in an MVC fashion. This means that the application includes the AspnetDB database. It also has a SQL Server Express database file named WebAdvert. WebAdvert database contains one table only which is named “Adverts”. Ads are stored in Adverts table. The structure of this table is as bellow:
Figure 1: Structure of Adverts table
Use the following credentials to login:
User name: admin
Password: password)_
Figure 2 the browsing page
Prerequisites
- Visual Studio 2010
- Visual C# Express Edition 2010
- Visual Web Developer 2010
- ASP.NET MVC 3
- Entity Framework 4
- SQL Server 2008 Express Edition
Download
Download WebAdvert ASP.NET MVC 3.0 source code from webadvert.codeplex.com

Thanks so much
Good sample. Thank you very much.
Nice, thanks.
Thx, but is there a razor sample?
btw, I see the image is a path. But when i tried to insert a record with a image upload. The image is not stored in database.
Any idea?
That might be because the path is too large to fit in the field
Sorry mate I’ve been busy with managing unmanageble stuff! I’m intended to develop a 2nd version of this project with the most recent MVC 3 features.
Hi.. Its very nice..iv been searching this type of tutorial.. wow nice .. thx lot
nice demo.
Can you tell me how to open the Excel sheet using asp.net mvc
Just opening and reading/writing an Excel file has nothing to do with the View so you can do it as you did before (in ASP.NET or other types of apps). I recommend you to use Visual Studio Tools for Office.
Hi When i tried tu run the project, visual studio show an error that say viewbag, does not exist in correct context,
you probably just have MVC 2 installed. download and install MVC 3 from ASP.NET web site
very nice sample application for learners of MVC3
Great example- thanks very much for sharing
Hi Aref,
I saw your sample application it was so simple and well structured but still I guess I am lagging the basics to understand these as I am new to this so can u pls suggest me which book to follow before starting an MVC3 application.
Hi Karthik
I made that simple app last year. I’ve been intended to make another version of it which employs best practices and MVC3 specific features such as Razor but honestly I have not find time to do so. so apologies for it.
O’Reily has a good ASP.NET MVC3 book which I like. Also there are some sample codes in MSDN (google it to find it) that will help.
thanks for your kind reply, I just started with your sample as it looks a bit simple and going with O’Reily. Hope this will help me out to get a knowledge in asp.net mvc 3
works perfectly, good job bro
nice example dude..
can’t wait to see its version in mvc3 r@zor…