Click here to Skip to main content
11,437,638 members (28,945 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Samples » Downloads
Add your own
alternative version

ASP.NET MVC Editable Table (jQuery DataTables and ASP.NET MVC integration - Part II)

, 6 Nov 2011 CPOL
This article shows how a datatable with standard CRUD functionalites (select/delete data, update single cell, and add new record) can be created in ASP.NET MVC using the jQuery DataTables Editable plug-in.
DataTableEditableProject.zip
DataTableEditable
bin
Content
dataTables
images
back_disabled.jpg
back_enabled.jpg
favicon.ico
forward_disabled.jpg
forward_enabled.jpg
Sorting icons.psd
sort_asc.png
sort_asc_disabled.png
sort_both.png
sort_desc.png
sort_desc_disabled.png
jAlert
themes
base
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
smoothness
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
Controllers
DataTableEditable.csproj.user
Global.asax
Models
obj
Debug
DataTableEditable.dll
TempPE
Properties
Scripts
Views
Company
Shared
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DataTableEditable.Models
{
    public class DataRepository
    {
    
        public static IList<Company> CompanyData = null;
        public static IList<Company> GetCompanies()
        {
            if (CompanyData == null)
            {
                CompanyData = new List<Company>();
                CompanyData.Add(new Company() { Name = "Emkay Entertainments", Address = "Nobel House, Regent Centre", Town = "Lothian" });
                CompanyData.Add(new Company() { Name = "The Empire", Address = "Milton Keynes Leisure Plaza", Town = "Buckinghamshire" });
                CompanyData.Add(new Company() { Name = "Asadul Ltd", Address = "Hophouse", Town = "Essex" });
                CompanyData.Add(new Company() { Name = "Gargamel", Address = "", Town = "" });
                CompanyData.Add(new Company() { Name = "Ashley Mark Publishing Company", Address = "1-2 Vance Court", Town = "Tyne & Wear" });
                CompanyData.Add(new Company() { Name = "MuchMoreMusic Studios", Address = "Unit 29", Town = "London" });
                CompanyData.Add(new Company() { Name = "Victoria Music Ltd", Address = "Unit 215", Town = "London" });
                CompanyData.Add(new Company() { Name = "Abacus Agent", Address = "Regent Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "Atomic", Address = "133 Longacre", Town = "London" });
                CompanyData.Add(new Company() { Name = "Pyramid Posters", Address = "The Works", Town = "Leicester" });
                CompanyData.Add(new Company() { Name = "Kingston Smith Financial Services Ltd", Address = "105 St Peter's Street", Town = "Herts" });
                CompanyData.Add(new Company() { Name = "Garrett Axford PR", Address = "Harbour House", Town = "West Sussex" });
                CompanyData.Add(new Company() { Name = "Derek Boulton Management", Address = "76 Carlisle Mansions", Town = "London" });
                CompanyData.Add(new Company() { Name = "Total Concept Management (TCM)", Address = "PO Box 128", Town = "West Yorks" });
                CompanyData.Add(new Company() { Name = "Billy Russell Management", Address = "Binny Estate", Town = "Edinburgh" });
                CompanyData.Add(new Company() { Name = "Stage Audio Services", Address = "Unit 2", Town = "Stourbridge" });
                CompanyData.Add(new Company() { Name = "Windsong International", Address = "Heather Court", Town = "Kent" });
                CompanyData.Add(new Company() { Name = "Vivante Music Ltd", Address = "32 The Netherlands", Town = "Surrey" });
                CompanyData.Add(new Company() { Name = "Way to Blue", Address = "First Floor", Town = "London" });
                CompanyData.Add(new Company() { Name = "Glasgow City Halls", Address = "32 Albion Street", Town = "Lanarkshire" });
                CompanyData.Add(new Company() { Name = "The List", Address = "14 High St", Town = "Edinburgh" });
                CompanyData.Add(new Company() { Name = "Wilkinson Turner King", Address = "10A London Road", Town = "Cheshire" });
                CompanyData.Add(new Company() { Name = "GSC Solicitors", Address = "31-32 Ely Place", Town = "London" });
                CompanyData.Add(new Company() { Name = "Vanessa Music Co", Address = "35 Tower Way", Town = "Devon" });
                CompanyData.Add(new Company() { Name = "Regent Records", Address = "PO Box 528", Town = "West Midlands" });
                CompanyData.Add(new Company() { Name = "BBC Radio Lancashire", Address = "20-26 Darwen St", Town = "Blackburn" });
                CompanyData.Add(new Company() { Name = "The Citadel Arts Centre", Address = "Waterloo Street", Town = "Merseyside" });
                CompanyData.Add(new Company() { Name = "Villa Audio Ltd", Address = "Baileys Yard", Town = "Essex" });
                CompanyData.Add(new Company() { Name = "cave 3", Address = "", Town = "" });
                CompanyData.Add(new Company() { Name = "Idle Eyes Printshop", Address = "81 Sheen Court", Town = "Surrey" });
                CompanyData.Add(new Company() { Name = "Miggins Music (UK)", Address = "33 Mandarin Place", Town = "Oxon" });
                CompanyData.Add(new Company() { Name = "Magic 999", Address = "St Paul's Square", Town = "Lancashire" });
                CompanyData.Add(new Company() { Name = "Delga Group", Address = "Seaplane House, Riverside Est.", Town = "Kent" });
                CompanyData.Add(new Company() { Name = "Zane Music", Address = "162 Castle Hill", Town = "Berkshire" });
                CompanyData.Add(new Company() { Name = "Universal Music Operations", Address = "Chippenham Drive", Town = "Milton Keynes" });
                CompanyData.Add(new Company() { Name = "Gotham Records", Address = "PO Box 6003", Town = "Birmingham" });
                CompanyData.Add(new Company() { Name = "Timbuktu Music Ltd", Address = "99C Talbot Road", Town = "London" });
                CompanyData.Add(new Company() { Name = "Online Music", Address = "Unit 18, Croydon House", Town = "Surrey" });
                CompanyData.Add(new Company() { Name = "Irish Music Magazine", Address = "11 Clare St", Town = "Ireland" });
                CompanyData.Add(new Company() { Name = "Savoy Records", Address = "PO Box 271", Town = "Surrey" });
                CompanyData.Add(new Company() { Name = "Temple Studios", Address = "97A Kenilworth Road", Town = "Middlesex" });
                CompanyData.Add(new Company() { Name = "Gravity Shack Studio", Address = "Unit 3 ", Town = "London" });
                CompanyData.Add(new Company() { Name = "Dovehouse Records", Address = "Crabtree Cottage", Town = "Oxon" });
                CompanyData.Add(new Company() { Name = "Citysounds Ltd", Address = "5 Kirby Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "Revolver Music Publishing", Address = "152 Goldthorn Hill", Town = "West Midlands" });
                CompanyData.Add(new Company() { Name = "Jug Of Ale", Address = "43 Alcester Road", Town = "West Midlands" });
                CompanyData.Add(new Company() { Name = "Isles FM 103", Address = "PO Box 333", Town = "Western Isles" });
                CompanyData.Add(new Company() { Name = "Headscope", Address = "Headrest", Town = "East Sussex" });
                CompanyData.Add(new Company() { Name = "Universal Music Ireland", Address = "9 Whitefriars", Town = "Ireland" });
                CompanyData.Add(new Company() { Name = "Zander Exports", Address = "34 Sapcote Trading Centre", Town = "London" });
                CompanyData.Add(new Company() { Name = "Midem (UK)", Address = "Walmar House", Town = "London" });
                CompanyData.Add(new Company() { Name = "La Rocka Studios", Address = "Post Mark House", Town = "London" });
                CompanyData.Add(new Company() { Name = "Warner Home DVD", Address = "Warner House", Town = "London" });
                CompanyData.Add(new Company() { Name = "Music Room", Address = "The Old Library", Town = "London" });
                CompanyData.Add(new Company() { Name = "Blue Planet", Address = "96 York Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "Dream 107.7FM", Address = "Cater House", Town = "Chelmsford" });
                CompanyData.Add(new Company() { Name = "Moneypenny Agency", Address = "The Stables, Westwood House", Town = "East Yorks" });
                CompanyData.Add(new Company() { Name = "Artsun", Address = "18 Sparkle Street", Town = "Manchester" });
                CompanyData.Add(new Company() { Name = "Clyde 2", Address = "Clydebank Business Park", Town = "Glasgow" });
                CompanyData.Add(new Company() { Name = "9PR", Address = "65-69 White Lion Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "River Studio's", Address = "3 Grange Yard", Town = "London" });
                CompanyData.Add(new Company() { Name = "Start Entertainments Ltd", Address = "3 Warmair House", Town = "Middx" });
                CompanyData.Add(new Company() { Name = "Vinyl Tap Mail Order Music", Address = "1 Minerva Works", Town = "West Yorkshire" });
                CompanyData.Add(new Company() { Name = "Passion Music", Address = "20 Blyth  Rd", Town = "Middlesex" });
                CompanyData.Add(new Company() { Name = "SuperVision Management", Address = "Zeppelin Building", Town = "London" });
                CompanyData.Add(new Company() { Name = "Lite FM", Address = "2nd Floor", Town = "Peterborough" });
                CompanyData.Add(new Company() { Name = "ISIS Duplicating Company", Address = "Sales & Production", Town = "Merseyside" });
                CompanyData.Add(new Company() { Name = "Vanderbeek & Imrie Ltd", Address = "15 Marvig", Town = "Scotland" });
                CompanyData.Add(new Company() { Name = "Glamorgan University", Address = "Student Union", Town = "Mid Glamorgan" });
                CompanyData.Add(new Company() { Name = "Web User", Address = "IPC Media", Town = "London " });
                CompanyData.Add(new Company() { Name = "Farnborough Recreation Centre", Address = "1 Westmead", Town = "Hampshire" });
                CompanyData.Add(new Company() { Name = "Robert Owens/Musical Directions", Address = "352A Kilburn Lane", Town = "London" });
                CompanyData.Add(new Company() { Name = "Magick Eye Records", Address = "PO Box 3037", Town = "Berks" });
                CompanyData.Add(new Company() { Name = "Alexandra Theatre", Address = "Station Street", Town = "West Midlands" });
                CompanyData.Add(new Company() { Name = "Keda Records", Address = "The Sight And Sound Centre", Town = "Middlesex" });
                CompanyData.Add(new Company() { Name = "Independiente Ltd", Address = "The Drill Hall", Town = "London" });
                CompanyData.Add(new Company() { Name = "Shurwood Management", Address = "Tote Hill Cottage", Town = "West Sussex" });
                CompanyData.Add(new Company() { Name = "Fury Records", Address = "PO Box 52", Town = "Kent" });
                CompanyData.Add(new Company() { Name = "Northumbria University", Address = "Union Building", Town = "Newcastle upon Tyne" });
                CompanyData.Add(new Company() { Name = "Pop Muzik", Address = "Haslemere", Town = "W. Sussex" });
                CompanyData.Add(new Company() { Name = "Jonsongs Music", Address = "3 Farrers Place", Town = "Surrey" });
                CompanyData.Add(new Company() { Name = "Hermana PR", Address = "Unit 244, Bon Marche Centre", Town = "London" });
                CompanyData.Add(new Company() { Name = "Sugarcane Music", Address = "32 Blackmore Avenue", Town = "Middlesex" });
                CompanyData.Add(new Company() { Name = "JFM Records", Address = "11 Alexander House", Town = "London" });
                CompanyData.Add(new Company() { Name = "Black Market Records", Address = "25 D'Arblay Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "Float Your Boat Productions", Address = "5 Ralphs Retreat", Town = "Bucks" });
                CompanyData.Add(new Company() { Name = "Creation Management", Address = "2 Berkley Grove", Town = "London" });
                CompanyData.Add(new Company() { Name = "Bryter Music", Address = "Marlinspike Hall", Town = "Suffolk" });
                CompanyData.Add(new Company() { Name = "The Headline Agency", Address = "39 Churchfields", Town = "Ireland" });
                CompanyData.Add(new Company() { Name = "MP Promotions", Address = "13 Greave", Town = "Cheshire" });
                CompanyData.Add(new Company() { Name = "Modo Production Ltd", Address = "Ground Floor", Town = "London" });
                CompanyData.Add(new Company() { Name = "Nomadic Music", Address = "Unit 18", Town = "London" });
                CompanyData.Add(new Company() { Name = "Reverb Records Ltd", Address = "Reverb House", Town = "London" });
                CompanyData.Add(new Company() { Name = "SIBC", Address = "Market Street", Town = "Lerwick" });
                CompanyData.Add(new Company() { Name = "Marken Time Critical Express", Address = "Unit 2", Town = "Isleworth" });
                CompanyData.Add(new Company() { Name = "102.2 Smooth FM", Address = "26-27 Castlereagh Street", Town = "London" });
                CompanyData.Add(new Company() { Name = "Chesterfield Arts Centre", Address = "Chesterfield College", Town = "Derbyshire" });
                CompanyData.Add(new Company() { Name = "The National Indoor Arena", Address = "King Edward's Road", Town = "West Midlands" });
                CompanyData.Add(new Company() { Name = "Salisbury City Hall", Address = "Malthouse Lane", Town = "Wiltshire" });
                CompanyData.Add(new Company() { Name = "Minder Music", Address = "", Town = "" });
            }
            return CompanyData;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jovan Popovic
Architect Gowi
Serbia Serbia
Started as a young scientist - winning the highest national awards in mathematics, physics, electrotechnics, and electronics.
Graduated from Faculty of Electrical Engineering, Department of Computer Techniques and Informatics, University of Belgrade, Serbia, as a first in the class, as a Master of Software Sciences.
Currently working in Gowi as a Software engineer, architect, and project manager since 2004 - mostly using Microsoft technologies (ASP.NET, C#). Member of JQuery community - created few popular plugins (four popular JQuery DataTables add-ins and loadJSON template engine).
Interests: Software engineering process(estimation and standardization), mobile and business intelligence platforms.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150506.1 | Last Updated 6 Nov 2011
Article Copyright 2011 by Jovan Popovic
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid