Wednesday, July 31, 2013

Tuesday, July 30, 2013

Get IE to display JsonResult instead of prompt to download

return Json(bm, "text/html", JsonRequestBehavior.AllowGet);

Html.ValidationSummary always showing

added this to fix

   <style type ="text/css">
    .validation-summary-valid { display:none; }
    </style>

[ControllerAction] deprecated and illegal

use [NonAction] instead

Monday, July 29, 2013

Linq Datatable subset as a datatable

blah.Rows.Cast<DataRow>().Where(row => row.Field<int>("ID").Equals(i)).CopyToDataTable();

will return onle where id = i

inserting partial views

<% Html.RenderPartial("heh"); %>

Parser Error Message: The type 'System.Web.Mvc.ViewPage' is ambiguous

fixed it thus:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>

  </runtime>

also, look here.