Click here to Skip to main content
15,885,985 members
Articles / Web Development / HTML

An Example to Use jQuery Grid Plugin in MVC - Part 1

Rate me:
Please Sign up or sign in to vote.
4.70/5 (17 votes)
1 Aug 2011CPOL7 min read 223.4K   10.4K   71  
This article presents a simple example on how to use jQuery Grid Plugin in MVC.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{E0BD688E-EA3D-4B88-A180-2D50A646D15D}</ProjectGuid>
    <ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>jqGridExamplePart1</RootNamespace>
    <AssemblyName>jqGridExamplePart1</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <MvcBuildViews>false</MvcBuildViews>
    <UseIISExpress>false</UseIISExpress>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
    <Reference Include="System.ComponentModel.DataAnnotations">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Extensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Web.Abstractions" />
    <Reference Include="System.Web.Routing" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Controllers\HomeController.cs" />
    <Compile Include="Controllers\jQGridController.cs" />
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>
    </Compile>
    <Compile Include="Models\StudentRepository.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Content\jquery-grid\ui.jqgrid.css" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_flat_0_aaaaaa_40x100.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_flat_55_fbec88_40x100.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_glass_75_d0e5f5_1x400.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_glass_85_dfeffc_1x400.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_glass_95_fef1ec_1x400.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_gloss-wave_55_5c9ccc_500x100.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_inset-hard_100_f5f8f9_1x100.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-bg_inset-hard_100_fcfdfd_1x100.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_217bc0_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_2e83ff_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_469bdd_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_6da8d5_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_cd0a0a_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_d8e7f3_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\images\ui-icons_f9bd01_256x240.png" />
    <Content Include="Content\jquery-ui\redmond\jquery-ui-1.8.14.custom.css" />
    <Content Include="Default.htm" />
    <Content Include="Global.asax" />
    <Content Include="Scripts\jquery-1.6.2.min.js" />
    <Content Include="Scripts\jquery-grid\grid.locale-en.js" />
    <Content Include="Scripts\jquery-grid\jquery.jqGrid.min.js" />
    <Content Include="Web.config" />
    <Content Include="Web.Debug.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
    <Content Include="Web.Release.config">
      <DependentUpon>Web.config</DependentUpon>
    </Content>
  </ItemGroup>
  <ItemGroup />
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target> -->
  <Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
  </Target>
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>False</AutoAssignPort>
          <DevelopmentServerPort>8290</DevelopmentServerPort>
          <DevelopmentServerVPath>/jqGridExamplePart1</DevelopmentServerVPath>
          <IISUrl>http://localhost/jqGridExamplePart1</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

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)


Written By
United States United States
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.

Comments and Discussions