Getting device filters, add this and .net to work together

←Back to listing

An issue I’ve come across a few times when adding an Add This button to any .net application is that the following error message is thrown:

The string 'fb:like:layout' contains too many device filters. There can be only one.

There’s something about the Highlander with that one, and it’s a bit irritating to say the least, but the fix is a simple one.

All you need to do is to enter the required Add This code without the device filters, and then add them with javascript (I use jQuery here):

<div class="addMe">
   <!-- AddThis Button BEGIN -->
   <div class="addthis_toolbox">
      <a class="addthis_button_facebook_like"></a>
      <a class="addthis_button_tweet"></a>
      <a class="addthis_counter addthis_pill_style"></a>
<script type="text/javascript">
   <script type="text/javascript" src="
<!-- AddThis Button END -->

I’m not quite sure why .net throws this error, and it’s a shame that javascript is required to fix it, but for now it’ll do.