Category: Development

  • The JSON request was too large to be deserialized

    The JSON request was too large to be deserialized is a very common error because of MVC’s default size for a JSON response from the Web Api. Luckily there is a very simple solution that requires a minor change in your Web.config

    (more…)

  • Include a JavaScript file in another file

    Including a JavaScript file into another file is a very nice thing to be able to do. It’s something you probably do with almost every other language; it helps keeping files smaller, more readable, and of course, more readable. There are multiple ways to accomplish this and I’ll let you pick the one that works best for you without using the Javascript string replace() function.

    (more…)

  • Solution to SameSite None iFrames with C#

    There has been a lot of kerfuffle over Chrome’s upcoming change to how cookies are based when one website is iFraming another website in an effort to further improve the security of the Internet.

    At the end of the day, the solution is to set your cookies – specifically the .ASPXAUTH cookie – so that when users navigate the website of the iFrame source the cookies will be passed from page-to-page. This is very important to those who are using FormAuthentication.

    The solution requires two changes. Let’s look at them now.

    (more…)

  • Deleting an element from an array in PHP

    There are multiple ways to delete an element from array with PHP: unset, array_splice, and array_diff. The splice method is very similar to my article on removing a specific element with JavaScript article.

    (more…)

  • Validate an email address in JavaScript

    This is my least favorite topic; validating email addresses. There are hundreds of examples using regular expressions that are all slightly different and all have there own quirks with them.

    If validation must be done, I suggest only doing this on the client-side. Ideally the server-side performs email validation by sending an actual email that includes a unique link to validate the email is valid.

    But if JavaScript is a must, here is the best one I’ve found.

    (more…)