Monday, February 18, 2008 8:51 PM Kazi Manzur Rashid

Kigg - A Digg like application developed in ASP.NET MVC

For last few weeks, I was bit busy developing a sample application with the new ASP.NET MVC Framework and I am really glad that we finally made it. So, from the DotNetSlackers.com Team I am presenting Kigg. Kigg  is Developed with:

  • Regular Web Forms for View.
  • LINQ to SQL for developing the Model.
  • ASP.NET Ajax for Ajax operation.
  • Both VSTest and NUnit for Unit Test.
  • Rhino Mock.

While developing it, our main goal was to make it simple and stupid, without considering those Ioc/DI, View Engine, View Factory etc, So the average Joe developer can get a good start on the ASP.NET MVC Framework.
We will soon publish a series of Articles which will cover the complete development details of Kigg.

You can see the live version running in DotNetSlackers.com.
The Source is as usual hosted in CodePlex.com.

Enjoy!!!.

Note: The Name Kigg = K is taken from DotNetKicks and igg from Digg.

kick it on DotNetKicks.com Filed under: , , ,

Comments

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 10:50 AM by Tyrone

Thank you. I have been looking for good examples of using MVC without all the Ioc/DI, View Engine, View Factory etc. I am that average Joe. :-)

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 11:33 AM by Pablo Marambio

Cool! Keep up the good work

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 11:53 AM by mehfuzh

Great, looks better than dotnetkicks, soon we will be kicking your icon :-)

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 1:40 PM by Kazi Manzur Rashid

Thanks everyone, Just keep an eye on my blog, I will be soon posting my experience on Asp.net MVC.

@Mehfuz: Thanks, It is just a sample on ASP.NET MVC, not to compete with the Good guys of DotNetKicks. But, you can surly use it as a template for creating more Professional Application.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 2:19 PM by Tyrone

Hi,

I am looking at your KiggDataContext class and you used the LINQ query API's instead of using the LINQ query syntax. Any reason why you choose this? Is it just preference?

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, February 18, 2008 2:48 PM by Kazi Manzur Rashid

Hi Tyrone,

The Lambda statements are much more compact and it is just my personal preference.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Tuesday, February 19, 2008 6:35 AM by shimulsays

Shanghatik. But missing n tier architecture using linq to sql.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Tuesday, February 19, 2008 2:00 PM by Shawn Oster

I'm curious about some of your design decisions from a learning perspective.

1. Why did you get rid of the default \Content folder in MVC applications?  Seems that is going to confuse people right off the bat when the stock MVC project has it yet Kigg doesn't.

2. Why put all the stuff that normally goes under \Content instead under Views?  Was this thinking that all view-related content goes with views?

3. I noticed you didn't go the RESTful route with your controllers.  Was this a design decision?  What prompted you not to use REST-style and instead the more "mega" controller?

4. You have "StoryItem", "TagItem", etc.  Lots of things that end with "Item".  How come you added Item on to the end of everything vs. just "Story", "Tag", etc?  Seems a given that everything is an Item which makes it redundant.

5. You don't use the MVCToolkit, was this a conscious choice or was it not available when you created the project?  

6. Since you don't use a REST style I'm curious how you're planning on integrating the back-end admin portion of a site like this?  Such as being able to edit tags, add categories, etc.

7. There is a bug in the latest version I have in the web config.  The connection string has:

AttachDbFileName=|DataDirectory|Kigg.mdf

Yet in the latest version I just grabbed the data file is actually named "KiggData.mdf".

I'm not being critical, just curious about the design decisions because I come from a Rails background in MVC and I'm trying to wrap my brain around what the conventions since I'm a huge fan of convention over configuration as well as having a consistent folder and project structure so that if you go from project A to project B you already know exactly where to find your stylesheets, javascript, views, how controllers are laid out, etc.

The project looks great by the way!  More full-featured examples like this will really help MVC adoption among the ASP.NET crowd I hope and really highlight how useful and clean a MVC approach is to site application design.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 1:33 AM by WebReservoir

Hi,

Any tutorials are available about installation and getting it working on VWD ( Visual Web Developer )

This would be of very important for students learning such type of projects for the first time.

Are there any plans to convert standard Classified Starter Kit ( Now available on asp.net downloads) to Asp.Net MVC .

Real Life examples like Classifieds would do wonders. How about starting Classified Project and making it work. It wan't take much time, since all the coding is already available and the Major thing to be done is getting it work with Asp.Net MVC way

Since Asp.Net MVC is a way to go in future, this would be really helpful and perhaps many would join this project too.

Just my 2 cents.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 3:02 AM by Kazi Manzur Rashid

@WebReservoir:

You can check the following article to configure the VWD for ASP.NET MVC.

geekswithblogs.net/.../117569.aspx

We have published the first part of the multipart series article on Developing Kigg, you will it in the following location:

dotnetslackers.com/.../KiggBuildingADiggCloneWithASPNETMVC1.aspx

I am not sure about the Classifieds Starter Kit as we are not the owner. But it will also be a good starting point for learning ASP.NET MVC. Pls Contact the Owner if they are interested enough to convert it.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 3:27 AM by Kazi Manzur Rashid

@shimulsays : Can you pls clarify what is an n-Tier application to you?

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 7:06 AM by WebReservoir

Hi Kazi,

Let me clarify that Classified Starter Kit is an open source project created in asp.net 2.0 by Microsoft for the asp.net community.

Its free to use and extend it, your way...

In fact Club Starter kit has reached version 3.0 beta and Personal Web Starter Kit is available now with LinQ2SQL.

Unfortunately no one thinks in Asp.Net way.. which majority will go in for.

I hope i have cleared your doubts.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 3:39 PM by Danny Douglass

I downloaded the code over at codeplex and recieve the following error when starting the application...

"Invalid object name 'dbo.Category'."

Any suggestions?  Thanks!

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 3:44 PM by Shawn Oster

I thought I posted this before but it seems to have disappeared down the tubes :)

A few questions around your design decisions from a learning perspective:

1. How come you didn't use the Content folder to store your common content like stylesheets and js?  This seems a little non-standard or at least confusing for someone first looking at the stock MVC project.

2. I noticed you didn't use REST-style controllers.  Was this a conscious design decision?

3. How do you plan to add in the admin-related functions, such as being able to rename tags, moderate posts, etc.  Usually with a REST-style you get these for free but I'm curious how you imagine it working.

4. How come your GetTagCloudHtml is a method at the top of your Master page vs. being a helper, ViewUserControl or HtmlHelper extension?  In Rails that would probably be turned into a partial with the weighting as a helper.

5. I noticed you didn't use the MVCToolkit, was this to reduce external references or a design decision?

6. Seems in your TagCloud weighting you'd be better served using CSS class selectors to indicate the weight and doing font-size in the CSS, makes it a little more flexable and would make it easier to use a grid-based or pure em layout without fixed font-sizes.

All my MVC work has been in Rails so I'm curious what the Microsoft conventions (over configuration) are going to be.  I predict we'll see two camps, the WebForm converts and then those that have Rails experience and we'll end up with two styles of ASP.NET MVC design approaches.

Love the example by the way!  Think it looks great and the community will benefit from having at least something to play with and learn from.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Wednesday, February 20, 2008 5:40 PM by Paul Kohler

Sweet! Thats very nice VSI package. Just one "bug" in the web.config file from the codeplex download though, the connection string looks for "Kigg.mdf" but the file is "KiggData.mdf". ASP.NET ends up creating a default database then the site errors because the table is not found...

Other than that it's a great starter with membership and emailing :-)

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 4:52 AM by Kazi Manzur Rashid

@WebReservoir:

I will give it a look if get any freee time.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 5:26 AM by Kazi Manzur Rashid

@Shawn Oster:

1. I do not like the Content folder, I think CSS/Images/JS are related with Views. Therefore, I put those under the Views Folder and it was completely my personal preference.

2. I am not sure what do you mean by REST-Style, Can you pls elaborate it.

3. I think all kind of user interaction that does not involve Search Engine should be ajaxified.

4. I am not familiar with Ruby on Rails. I have been always in MS platform. Certainly, I would put the Tag Cloud Generation in a different User Control or Helper class if I need to use it more than one Page. But as you can see, the Tag cloud is shown in every page so I think the best place is the Master Page for this code.

5. Yes, I do not want another dependency, I just want to show the Power of the Core MVC Framework.

6. Yes, you are correct, css is much preferred way to do it, but I am not a design expert :-(.

I am not right the Right Person to answer the Microsoft Conventions over configuration in MVC Framework, so I am skipping it.

Yes, you are absolutely correct about the two camps and I am from  the Web Forms Camp, In fact, I came from strong windows application background.

Thanks for the complement; it is really the appreciation of the community, which inspires to create this kind of samples.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 5:50 AM by Kazi Manzur Rashid

@Paul Kohler:

Thanks for pointing that out, i will fix it right away.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 5:55 AM by Kazi Manzur Rashid

@Danny:

I think you should change the connection string what Paul has suggested.

Sorry for the inconvenience.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 7:28 AM by Shafqat Ahmed

Awesome work!!

# re: Kigg - A Digg like application developed in ASP.NET MVC

Thursday, February 21, 2008 7:51 AM by Kazi Manzur Rashid

@Shawn Oster:

Sorry, I found your first comment after answering the second. I think I have already answered few of them.

>>>>>>3. I noticed you didn't go the RESTful route with your controllers.  Was this a design decision?  What prompted you not to use REST-style and instead the more "mega" controller?

If you mean to use the PUT, DELETE etc verbs then I think most of the ASP.NET Developers are not familiar with those commands, moreover the application that I have presented is not a CRUD style, so I could not find any good reason to implement those.

>>>>>>4. You have "StoryItem", "TagItem", etc.  Lots of things that end with "Item".  How come you added Item on to the end of everything vs. just "Story", "Tag", etc?  Seems a given that everything is an Item which makes it redundant.

Yes, it is also confusing to me. In LINQ to SQL when you map your db tables with entities it ends up having the same sort of name, but in your application you need your custom entities, which works on top of those LINQ to SQL generated entities. For example, to generate the tag cloud you need to know the tag name as well  as the count of that tag that is used in the stories.

I think it would be much more appropriate if I name those LINQ to SQL entities StoryTable, CategoryTable etc. What do you think?

# re: Kigg - A Digg like application developed in ASP.NET MVC

Friday, April 11, 2008 6:20 AM by George McGrane

Hi there - was just wondering I might be able to get a little help getting this working, I can open Kigg at all, keep getting an error saying that " Ths type is not supported by this installation" The web packs are installed ok but the VsTest project and Nunit dont seem to be opening, (I have installed NUnit but am not sure what VSTest is) I am running vista prem, and have VS2008 standard as my IDE, Any help would be great.

Thanks

George

# re: Kigg - A Digg like application developed in ASP.NET MVC

Friday, April 18, 2008 10:39 AM by tareq

What are the server requirements for this application?

Will this run on windows 2003 Server?

# re: Kigg - A Digg like application developed in ASP.NET MVC

Saturday, April 26, 2008 9:38 PM by Kazi Manzur Rashid

@George:

VS/MS Test is not supported in vs standard edition and for this i have provided the nunit version.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Saturday, April 26, 2008 9:41 PM by Kazi Manzur Rashid

@tareq: You need to have .net 3.5, ASP.net, MVC preview 2, IIS6/7 and MS SQL server to run the application.

# re: Kigg - A Digg like application developed in ASP.NET MVC

Saturday, July 5, 2008 1:02 AM by ankur

kigg is  a good application..

# re: Kigg - A Digg like application developed in ASP.NET MVC

Friday, September 12, 2008 7:28 PM by blank

I use windowsxp+iis5.1 and vs2008+sql server2005+.net3.5

MVC Preivew 3.

when I build It say RenderView can not find I something suggest

replace RenderView whit View.

Howerer when run,It give blank space, when?

MS did not supply mvc preview 2 to download

# re: Kigg - A Digg like application developed in ASP.NET MVC

Tuesday, January 20, 2009 12:43 AM by ?

I don't understand the Linq To Sql mapping part. How does it map to  Domain Objects? Manually writing mapping files???

# re: Kigg - A Digg like application developed in ASP.NET MVC

Monday, March 16, 2009 12:32 PM by JNorte

I have this error when try acess my site:

http://localhost/KiGG

As any ideia how can solve this?

Could not load type 'System.Web.Mvc.ValidateInputAttribute' from assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Thanks