Articles : Page 1 of 1

  • Using an alternate JSON Serializer in ASP.NET Web API

    Using an alternate JSON Serializer in ASP.NET Web API

    Mar 12
    09

    The new ASP.NET Web API that Microsoft released alongside MVC 4.0 Beta last week is a great framework for building REST and AJAX APIs. I've been working with it for quite a while now and I really like the way it works and the complete set of features it provides 'in the box'. It's about time that Microsoft gets a decent API for building generic HTTP endpoints into the framework. DataContractJsonSerializer sucks As nice as Web API's overall design is one thing still sucks: The built-in JSON S...


  • XmlWriter and lower ASCII characters

    XmlWriter and lower ASCII characters

    Jan 12
    02

    Ran into an interesting problem today on my CodePaste.net site: The main RSS and ATOM feeds on the site were broken because one code snippet on the site contained a lower ASCII character (CHR(3)). I don't think this was done on purpose but it was enough to make the feeds fail. After quite a bit of debugging and throwing in a custom error handler into my actual feed generation code that just spit out the raw error instead of running it through the ASP.NET MVC and my own error pipeline I foun...


  • Prevent Forms Authentication Login Page Redirect When You Don’t Want It

    Prevent Forms Authentication Login Page Redirect When You Don’t Want It

    Oct 11
    04

    Go that way instead - Photo by JacobEnos CC some rights reserved In an ASP.NET web application, it’s very common to write some jQuery code that makes an HTTP request to some URL (a lightweight service) in order to retrieve some data. That URL might be handled by an ASP.NET MVC controller action, a Web API operation, or even an ASP.NET Web Page or Web Form. If it can return curly brackets, it can be respond to a JavaScript request for JSON. One pain point when hosting lightweight HTTP ser...


  • New Ajax Grid Scaffolding NuGet Package for MVC 3

    New Ajax Grid Scaffolding NuGet Package for MVC 3

    Aug 11
    18

    EDITOR’S NOTE: Microsoft has an amazing intern program. For a summer, these bright college students work with a feature crew getting real work done, all the while attending cool events nearly every week that, frankly, make the rest of us jealous! Just look at some of the perks listed in this news article! This summer, the ASP.NET MVC is hosting an intern, Stephen Halter, who while very smart, doesn’t have a blog of his own (booo! hiss!). Being the nice guy that I am (and also being amenable ...


  • How to convert an ASP.NET Web Forms web application into ASP.NET MVC 3

    How to convert an ASP.NET Web Forms web application into ASP.NET MVC 3

    May 11
    06

    So, you have a traditional web forms web application and you are inspired by the new ASP.NET MVC 3 are you? Well this is definitely doable. In this how to guide I will tell you step by step exactly how you can add your new ASP.NET MVC 3 work into your existing ASP.NET web forms project. 1. Add referencesRight click on your web root project in Visual Studio (2010 in my case) and add the following references: System.Web.Routing System.Web.Abstractions System.Web.Mvc System.WebPages System.Web...


  • Pushing Code to NuGet

    Pushing Code to NuGet

    May 11
    06

    I kicked up some dust yesterday when I suggested that pushing packages to Nuget could be a bit easier. Many retorts of “how could it possibly be simpler!?!?!?!” (I never grow tired of condescension - it makes me write posts :) and I thought to myself: “there has to be other people in my position”. So here it is - the Simple Guide To Pushing Code to Nuget - mostly for me to remember how to do it, but if you find it helpful yay!  NuGet.exe The first thing you’ll need is NuGet.exe. It’s a pa...


  • EF Code First and Data Scaffolding with the ASP.NET MVC 3 Tools Update

    EF Code First and Data Scaffolding with the ASP.NET MVC 3 Tools Update

    May 11
    06

    Earlier this week I blogged about the new ASP.NET MVC 3 Tools Update that we shipped last month. In today’s blog post I’m going to go into more detail about two of the cool new features it brings: Built-in support for EF 4.1 (which includes the new EF “code-first” support) Built-in data scaffolding support within Visual Studio (which enables you to rapidly create data-driven sites) These two features provide a really sweet, and extremely powerful, way to work with data and build d...


  • ASP.NET GZip Encoding Caveats

    ASP.NET GZip Encoding Caveats

    May 11
    02

    GZip encoding in ASP.NET is pretty easy to accomplish using the built-in GZipStream and DeflateStream classes and applying them to the Response.Filter property. While applying GZip and Deflate behavior is pretty easy there are a few caveats that you have watch out for as I found out today for myself with an application that was throwing up some garbage data. But before looking at caveats let’s review GZip implementation for ASP.NET. ASP.NET GZip/Deflate Basics Response filters basically are ...


  • Building a Nuget Server with gold plating

    Building a Nuget Server with gold plating

    Apr 11
    05

    Last week, Phil Haack wrote a post on how to build a NuGet Server. A NuGet server is really easy to build because 90% of the work is done by running a NuGet command. Just for fun, I decided to add some extra functionality to my NuGet Server such as a package upload form and a formatted list of packages. In preparing my NuGet server, I followed Phil’s direction to a tee except for the fact that I used a “empty MVC 3 app with Razor support” instead of using a “ASP.NET Empty Web Application”. ...



  • 1