Wednesday, May 13, 2015

How to check if IQueryable result set is null or empty

list will never be null with LINQ; it will simply represent an "empty collection" if need be. The way to test is with the Any extension method:
if (list.Any()) 
{
// list has at least one item
}

What “exec sp_reset_connection” shown in Sql Profiler means?

sp_reset_connection indicates that connection pool is being reused

Saturday, May 9, 2015

Disabling Chrome, Firefox, Safari, Opera, IE Autofill

<form>
<!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
<input style="displaynone" type="text" name="fakeusernameremembered" />
<input style="displaynone" type="password" name="fakepasswordremembered" />
</form>

Friday, May 8, 2015

Value cannot be null. Parameter name: panelsCreated[0] asp net

Switch scriptmanager mode to release

<asp:ScriptManager runat="server" ScriptMode="Release" />

InvalidOperationException: Could not find UpdatePanel with ID asp net

Change ClientIDMode on UpdatePanels to AutoID

<asp:UpdatePanel runat="server" ClientIDMode="AutoID">