Click here to Skip to main content
15,897,704 members
Articles / Web Development / ASP.NET

Implement CRUD Operations using RESTful WCF Service and JavaScript

Rate me:
Please Sign up or sign in to vote.
4.87/5 (24 votes)
15 Sep 2011CPOL5 min read 136.2K   11.4K   137  
Easy way to consume WCF REST services through JQuery and perform CRUD (Create Retrieve Update Delete) operations
<?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>{DEC2191D-D32A-4EC7-8E90-C1CA616B89A5}</ProjectGuid>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>QGridDemo</RootNamespace>
    <AssemblyName>QGridDemo</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </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.Core" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data.Entity" />
    <Reference Include="System.Data.Services" />
    <Reference Include="System.Data.Services.Client" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Security" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.ServiceModel.Web" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Configuration" />
    <Reference Include="System.Web.Services" />
    <Reference Include="System.EnterpriseServices" />
    <Reference Include="System.Web.DynamicData" />
    <Reference Include="System.Web.Entity" />
    <Reference Include="System.Web.ApplicationServices" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="About.aspx" />
    <Content Include="Account\ChangePassword.aspx" />
    <Content Include="Account\ChangePasswordSuccess.aspx" />
    <Content Include="Account\Login.aspx" />
    <Content Include="Account\Register.aspx" />
    <Content Include="Scripts\Grid\arrow_down.png" />
    <Content Include="Scripts\Grid\arrow_up.png" />
    <Content Include="Scripts\Grid\buttons.css" />
    <Content Include="Scripts\Grid\cycle_five.gif" />
    <Content Include="Scripts\Grid\globalheader.png" />
    <Content Include="Scripts\Grid\grid.css" />
    <Content Include="Scripts\Grid\loader.css" />
    <Content Include="Scripts\Grid\pager.js" />
    <Content Include="Scripts\Grid\pre-loader.gif" />
    <Content Include="Scripts\Grid\sprite.png" />
    <Content Include="Scripts\Grid\text.css" />
    <Content Include="Scripts\Grid\ui.jqgrid.css" />
    <Content Include="Scripts\jquery-1.5.1.js" />
    <Content Include="Scripts\jquery-ui.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.blind.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.bounce.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.clip.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.core.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.drop.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.explode.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.fade.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.fold.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.highlight.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.pulsate.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.scale.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.shake.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.slide.js" />
    <Content Include="Scripts\Jquery-UI\jquery.effects.transfer.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.accordion.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.autocomplete.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.button.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.core.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.datepicker.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.dialog.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.draggable.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.droppable.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.menu.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.menubar.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.mouse.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.popup.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.position.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.progressbar.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.resizable.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.selectable.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.slider.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.sortable.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.spinner.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.tabs.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.tooltip.js" />
    <Content Include="Scripts\Jquery-UI\jquery.ui.widget.js" />
    <Content Include="Scripts\jquery.easing.1.3.js" />
    <Content Include="Scripts\jquery.tmpl.js" />
    <Content Include="Services\EFService.svc" />
    <Content Include="Styles\jquery-ui-1.8.13.custom.css" />
    <Content Include="Styles\Site.css" />
    <Content Include="Default.aspx" />
    <Content Include="Global.asax" />
    <Content Include="Scripts\jquery-1.4.1-vsdoc.js" />
    <Content Include="Scripts\jquery-1.4.1.js" />
    <Content Include="Scripts\jquery-1.4.1.min.js" />
    <Content Include="test.aspx" />
    <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>
    <Compile Include="About.aspx.cs">
      <DependentUpon>About.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="About.aspx.designer.cs">
      <DependentUpon>About.aspx</DependentUpon>
    </Compile>
    <Compile Include="Account\ChangePassword.aspx.cs">
      <DependentUpon>ChangePassword.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Account\ChangePassword.aspx.designer.cs">
      <DependentUpon>ChangePassword.aspx</DependentUpon>
    </Compile>
    <Compile Include="Account\ChangePasswordSuccess.aspx.cs">
      <DependentUpon>ChangePasswordSuccess.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Account\ChangePasswordSuccess.aspx.designer.cs">
      <DependentUpon>ChangePasswordSuccess.aspx</DependentUpon>
    </Compile>
    <Compile Include="Account\Login.aspx.cs">
      <DependentUpon>Login.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Account\Login.aspx.designer.cs">
      <DependentUpon>Login.aspx</DependentUpon>
    </Compile>
    <Compile Include="Account\Register.aspx.cs">
      <DependentUpon>Register.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Account\Register.aspx.designer.cs">
      <DependentUpon>Register.aspx</DependentUpon>
    </Compile>
    <Compile Include="App_Logics\Business Entities\Business Entities1.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Business Entities.tt</DependentUpon>
    </Compile>
    <Compile Include="App_Logics\Data Access Layer\Data Access Layer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Data Access Layer.tt</DependentUpon>
    </Compile>
    <Compile Include="App_Logics\Data Access Layer\SocialShareDatabaseContext.Custom.cs" />
    <Compile Include="App_Logics\Entity Model\DatabaseContext.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>DatabaseContext.edmx</DependentUpon>
    </Compile>
    <Compile Include="Default.aspx.cs">
      <DependentUpon>Default.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Default.aspx.designer.cs">
      <DependentUpon>Default.aspx</DependentUpon>
    </Compile>
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Services\EFService.svc.cs">
      <DependentUpon>EFService.svc</DependentUpon>
    </Compile>
    <Compile Include="Site.Master.cs">
      <DependentUpon>Site.Master</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="Site.Master.designer.cs">
      <DependentUpon>Site.Master</DependentUpon>
    </Compile>
    <Compile Include="test.aspx.cs">
      <DependentUpon>test.aspx</DependentUpon>
      <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="test.aspx.designer.cs">
      <DependentUpon>test.aspx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="App_Data\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Account\Web.config" />
    <Content Include="Site.Master" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App_Logics\Business Entities\Business Entities.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>Business Entities1.cs</LastGenOutput>
    </None>
    <EntityDeploy Include="App_Logics\Entity Model\DatabaseContext.edmx">
      <Generator>EntityModelCodeGenerator</Generator>
      <LastGenOutput>DatabaseContext.Designer.cs</LastGenOutput>
    </EntityDeploy>
    <None Include="App_Logics\Data Access Layer\Data Access Layer.tt">
      <Generator>TextTemplatingFileGenerator</Generator>
      <LastGenOutput>Data Access Layer.cs</LastGenOutput>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>1038</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>
          </IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
  <!-- 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">
  </Target>
  -->
</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
Chief Technology Officer
Bangladesh Bangladesh
I am a Software Engineer and Microsoft .NET technology enthusiast. Professionally I worked on several business domains and on diverse platforms. I love to learn and share new .net technology and my experience I gather in my engineering career. You can find me from here

Personal Site
Personal Blog
FB MS enthusiasts group
About Me

Comments and Discussions