Click here to Skip to main content
14,217,582 members
Articles » Web Development » ASP.NET » General » Downloads

JSON API

Rate this:
4.90 (100 votes)
Please Sign up or sign in to vote.
4.90 (100 votes)
6 Dec 2011CPOL
A simple look at how to share the JSON API to Web and Desktop.
MVC_JSON
Common
bin
Debug
Common.dll
Common.pdb
obj
Debug
Common.dll
Common.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
ConsoleApplication1
bin
Debug
Common.dll
Common.pdb
ConsoleApplication1.exe
ConsoleApplication1.pdb
ConsoleApplication1.vshost.exe
obj
x86
Debug
ConsoleApplication1.exe
ConsoleApplication1.pdb
DesignTimeResolveAssemblyReferencesInput.cache
ResolveAssemblyReference.cache
TempPE
Properties
MvcApplication1.suo
packages
HttpClient.0.5.0
lib
JsonValue.0.5.0
JsonValue.0.5.0.nupkg
lib
40
Microsoft.Json.dll
Microsoft.Server.Common.dll
RestfulWebSite
App_Data
bin
Common.dll
Common.pdb
Microsoft.Json.dll
Microsoft.Server.Common.dll
RestfulWebSite.dll
RestfulWebSite.pdb
Content
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
Controllers
Filter
ModelBinders
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
ResolveAssemblyReference.cache
RestfulWebSite.dll
RestfulWebSite.pdb
TempPE
Properties
RestfulWebSite.csproj.user
Scripts
Views
Home
Shared
WEB_WCF
Lib
WCF Web API Preview 4
Microsoft.ApplicationServer.Common.dll
Microsoft.ApplicationServer.Common.XML
Microsoft.ApplicationServer.Http.dll
Microsoft.ApplicationServer.Http.XML
Microsoft.ApplicationServer.HttpEnhancements.dll
Microsoft.ApplicationServer.HttpEnhancements.Tests.dll
Microsoft.ApplicationServer.HttpEnhancements.XML
Microsoft.ApplicationServer.Serialization.dll
Microsoft.ApplicationServer.Serialization.XML
Microsoft.ApplicationServer.ServiceModel.dll
Microsoft.Net.Http.dll
Microsoft.QueryComposition.dll
Microsoft.Runtime.Serialization.Json.dll
Microsoft.ServiceModel.Web.jQuery.dll
Models
bin
Debug
Models.dll
Release
obj
Debug
Models.dll
TempPE
Properties
RestFul_Test
bin
Debug
Microsoft.ApplicationServer.Common.dll
Microsoft.ApplicationServer.Http.dll
Microsoft.ApplicationServer.Serialization.dll
Microsoft.ApplicationServer.ServiceModel.dll
Microsoft.Net.Http.dll
Microsoft.QueryComposition.dll
Microsoft.Runtime.Serialization.Json.dll
Microsoft.ServiceModel.Web.jQuery.dll
Models.dll
RestFul_Test.exe
RestFul_Test.vshost.exe
Release
obj
x86
Debug
RestFul_Test.exe
TempPE
Properties
RESTFul_WCF
App_Data
bin
EF_TEST.exe
Microsoft.ApplicationServer.Common.dll
Microsoft.ApplicationServer.Http.dll
Microsoft.ApplicationServer.HttpEnhancements.dll
Microsoft.ApplicationServer.Serialization.dll
Microsoft.ApplicationServer.ServiceModel.dll
Microsoft.Net.Http.dll
Microsoft.QueryComposition.dll
Microsoft.Runtime.Serialization.Json.dll
Microsoft.ServiceModel.Web.jQuery.dll
Models.dll
RESTFul_WCF.dll
obj
Debug
RESTFul_WCF.dll
TempPE
Properties
RESTFul_WCF.csproj.user
<?xml version="1.0"?>

<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />

    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>

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

Sacha Barber
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Stats

210.4K views
6.6K downloads
237 bookmarked