If you use the Bootstrap Accordion sample as the basis for a UI in an Angular application using ui-router and nested views, you may get unexpected re-routing when you collapse a section.

The reason for this is that the sample uses the href attribute for collapse toggling, rather than the data-target attribute. This nuance causes ui-router to attempt to redirect your application to the href value, which will likely not be found and instead load your “otherwise” view. Simply change your hrefs to data-targets and all should be well.

Thanks to Pankaj Parkar for pointing out this simple solution here.

The default Bootstrap 3.X Accordion can be easily extended with glyphicons to illustrate that the sections are expandable or collapsible as shown below:

The accordion with +/- glyphicons

The accordion with +/- glyphicons

The glyphicons are added as classes to span tags within the title links, and JavaScript is used to toggle the associated span class when a section is shown or hidden.

A working example is available on JSFiddle.

Based upon the techniques described in this post.

When creating a Kendo UI grid in ASP.Net MVC, make sure that the Name property you assign the grid is not the same as the id of the container, e.g. <div> tag. The result is a  duplicate, non-functional set of paging controls at the top of the grid (and probably other problems as well).

Unwanted paging controls due to duplicate id values

Unwanted paging controls due to duplicate id values

Travis Illig describes how to get around the “file in use by another process” issue that many users face in highly managed desktop environments.

I ran into some unexpected behavior in SQL Server 2012 with identity reseeding.

The behavior is that the identity value can skip by 1000 when a new row is added. Apparently this is a feature in SQL Server 2012. It occurs when tables have auto-incrementing IDs and less than 1000 rows; a SQL Server restart or failover will cause this behavior to occur.

Who knew? Apparently, a lot of people. Here is a nice description of the problem and some workarounds. Also, Microsoft considers this behavior to be by design.

I have not seen this behavior in SQL Server 2014, though I am not sure if the “restarting” ONLY refers to restarting the instance, versus restarting the entire server. I know I have rebooted the machine on several occasions for Windows Updates and not experienced the problem.

In practice, identify auto-incrementing does not necessarily always yield the next value in the sequence, so many people have pointed out that you should not rely on these ID fields as a definitive, predictable identifiers. Rather, you should implement your own sequencing to ensure that you ALWAYS get a predictable result.

I’m setting up VS 2013 on a highly restrictive, managed desktop environment, and ran into this problem when trying to load existing projects from TFS. The error message is shown below:

Error message when loading an existing Visual Studio project

Error message when loading an existing Visual Studio project

The solution was to browse to this file and change its permissions, which I discovered were set to read-only for some reason. After that, the projects were loaded successfully.

The utility bginfo, which displays system information on the desktop of the machine it is installed upon, is a handy tool to help identify your machines when you might be connected to several at one time.

It is pretty easy to deploy and configure, the only challenge I faced with it is getting it configured to run for every user, rather than just my own login. The general solution is to create a shortcut to the .exe and place it in the right location for All Users, which can be a little tricky to find if you aren’t a server admin who does this all of the time. Read the rest of this entry »

The accepted answer of this Stack Overflow post offers a pretty simple technique for extending IPrincipal to modify the display of the “Hello <username>” link in the _LoginPartial view.  In my case, username is an email address, so lengthy email addresses were taking up a lot of room on the top Navigation section, and I wanted something shorter (and sweeter).

The approach involves creating a custom claim during login and setting the desired value there, then retrieving the value via an extension method that reads the claim and returns the value. The partial view is updated to call the extension method instead of the default when creating the ActionLink for password modification.

This solution relies on having already extended the default ApplicationUser implementation to include additional properties such as FirstName, LastName, or FullName.

I’ve recently set up an Azure Recovery Service to backup some user-generated content from a web application that is hosted in our data center. My backup scenario is very simple; I am backing up nightly (for disaster recovery purposes only) the content in file system folders which are the destination for documents uploaded by users.

I was pleasantly surprised by how easy the setup was, and the scheduling and performance was straightforward and fast, respectively. I don’t have any other options for offsite backup (only elsewhere in the same data center), so Azure Recovery really seemed to meet my needs with little effort required by me. The only issue that I found confusing, and which has taken some time and experimentation to work through, was configuring the backup retention settings. Read the rest of this entry »

Miscellaneous resources to get started:

Tutorial for setting up Azure as a backup location.

Deleting backup BLOB files with stale leases. This seems to happen when backups are restored, afterwards they possibly cannot be deleted. Includes PowerShell script to release leases, allowing deletion of the files.

Running backup scripts programmatically, for instance via Task Scheduler. From the Best Practices Guidelines, selected login must have the grant to “Alter any credential” in the target database, otherwise they will receive a message stating “Credential name does not exist or user does not have permission to access it”. Apparently, it is not necessary to map the credential to the login, only that they have the grant.