title: ASP .NET MVC 5 model binding of byte[] produces null value with ajax GET reqest
body: <p>I'm trying to populate a variable for the following method in my Controller.</p>
  
  <pre><code>public ActionResult Index(byte[] status, byte type)
  </code></pre>
  
  <p>My problem is that I keep getting - <strong><em>null</em></strong> - for this parameter when making an AJAX call using jQuery.</p>
  
  <p>The byte[] '<em>status</em>' is intended to serve as a collection of values to compare records in a DB query, so as to return all the record that match one or more condition (status: 0=pending, 1=Completed etc.) </p>
  
  <p><strong>SIDE NOTE</strong>: The table wherein these records are stored has the '<em>status</em>' and '<em>type</em>' columns defined as a <strong><em>tinyint</em></strong> ... thus POCO classes are generated with these properties defined as byte :/</p>
  
  <p>This is the jQuery AJAX call </p>
  
  <p><code>$.get(
  "/Activity/Index", 
  $.param({ type: $actiontype, status: $status }),
  function (response) { $('#ActivitySubIndex').html(response) }
  )</code></p>
  
  <p>which produces a GET request like this </p>
  
  <pre><code>http://localhost:8084/Activity/Index?type=0&amp;status[]=0&amp;status[]=1&amp;status[]=2
  </code></pre>
  
  <p><strong>SO</strong> ... </p>
  
  <p>when I change the way jQuery preps the data being sent to the server by specifying the " <em>traditional</em> " flag on the $.param function like so </p>
  
  <p><code>$.param({ type: $actiontype, status: $status }, true)</code></p>
  
  <p>it produces a request like this </p>
  
  <pre><code>http://localhost:8084/Activity/Index?type=0&amp;status=0&amp;status=1&amp;status=2
  </code></pre>
  
  <p><strong>BUT</strong> ...now I get an error from the server saying </p>
  
  <blockquote>
    <p>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. </p>
  </blockquote>
  
  <p>Not too sure about that ... so now I'm left with figuring out how model binding (or whatever MVC does behind the scenes) is falling over.</p>
  
  <p>Any advice is greatly appreciated!</p>