Author: Jamie

  • Using DB_NAME with MSSQL

    I’ll admit, I haven’t used the DB_NAME very often. I pretty much use it in a single scenario. With all of my projects I use Continuous Deployment or Continuous Integration, whatever your choice of word is. When doing CI I have automatic deployment of any database scripts that need to run as I deploy to each environment: local, development, production, etc.

    On occasion, a script needs to apply a custom value for each environment like a user ID. To accomplish I use DB_NAME to perform a case statement as follows.

    (more…)

  • PHP: self vs $this – what’s the difference?

    This is a very unique topic that I found very interesting. Inside a class with PHP you can access a property or method by using either: self::myVariable or $this->myVariable. Let’s explore the unique difference, specifically with how it relates to polymorphism.

    (more…)

  • 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…)