Using Google Adsense With BlogEngine.NET 2.0

by Rob 10. June 2011 21:30

If you've used BlogEngine in the past; you might be familar with the AdSense widget or the Literal widget....but they don't seem to work in 2.0!  So, how do you get your Google Adsense Ads into your site?

First, log in and go to your home page.  Look for the 'widget' dropdown on the right-hand side of the page.

Select 'Textbox' and click the 'Add' button.  You should see a new TextBox Widget Appear.  Click 'Edit'

You should see something that looks like this.  Unclick 'Show title'.

DO NOT paste your adsense code into the textbox.  It won't work!  The TextBox widget will escape important characters.  Just type the word 'TEST' and hit save.

Now browse to your webserver and enter the 'App_Data/datastore/widgets/' folder.  Locate a .xml file with a timestamp of a few seconds go.  Download it and open it.  

Take the Javascript from Google's Adsense page (it should look like this)

<script type="text/javascript"><!--
google_ad_client = "ca-pub-2052174281835744";
/* Blog - Side Bar Small */
google_ad_slot = "3419877836";
google_ad_width = 250;
google_ad_height = 250;
<script type="text/javascript"

And replace all of the < with &lt; replace all of the > with &gt; and replace all of the " with &quote; - then remove the endlines.  Paste this line into the value field.


<?xml version="1.0" encoding="utf-8"?>
    <DictionaryEntry Key="content" Value="<script type="text/javascript"><!--google_ad_client = "ca-pub-2052174281835744";/* Blog - Side Bar Small */google_ad_slot = "3419877836";google_ad_width = 250;google_ad_height = 250;//--></script><script type="text/javascript"src=""></script>" />


Hit save and upload to the server.  Now, visit your site....TaDa!  It's not as easy as the old AdSense widget or the old Literal widget; but it gets the job done.  


The End Of (Your) Spam....

by Rob 5. June 2011 13:29

In the grand scheme of things, spam is probably low on your list of daily concerns.  But you are probably sick and tired of it.  Where does it come from?  And how did they get your e-mail address in the first place?  Why isn't there a simple solution to spam....

Presenting:  Rob Paulson's Spam Solution!

Relax.  I'm not selling anything.  But, if you are willing to pay the trivial $10 dollars or so each year to register a domain name - not only can you avoid spam completely, you'll also be able to track down exactly who sold you out.  Which company you did legitamate business with decided to sell your e-mail to spammers.  Which company was too lazy to protect their data that is now in the hands of spammers and phishers!

And it's pretty easy....

Step #1 - Register a Domain Name. 

Step #2 - Configure Google Apps to Work With Your Domain 

Step #3 - Setup Filters In Gmail

Got it?  That's it!  

Let me walk you through it.  See, once you have your domain name (like you don't have one e-mail address.  You have a near infinate number of email addresses.  Any single combination of valid characters is an e-mail address.  All of them.  And now you have an infalible way of sorting incoming messages!

Now, you use a different e-mail address for each site or company you do business with.

If you order from - you give them the email address ''
If you order pizza from - you give them the email address ''

Every single thing you do, you give it a different e-mail address.

And, when the spam comes in - you know EXACTLY which company sold you out!  Not only can you voice your objection to their policies, you can add ONE RULE that will automatically delete anything sent to that ONE e-mail address.  All of your other email continues to be received as expect.

Problem solved.  Everyone you do business with gets a unique email address that gets forwarded to the one account you check (but don't distribute) and that clearly indicates who they are.  If you ever do get spam sent to one of those e-mail addresses, you create a rule that deletes everything sent to that e-mail.  Everything else continues to work.  Plus, who doesn't want a domain name?  

At least, problem solved so long as a minority of internet users take this approach.  For the time being, I'm not concerned.  You'll get a few random emails to common addresses like '' that you'll quickly create filters to handle.

You'll also get the added benefit of having additional control over your e-mail experience.  If you use Gmail or Hotmail for all your email needs and, tomorrow, they make a change you don't agree can either go along with it, or you can give up your e-mail address.  It took legislation to seperate your phone number from your cell phone provider; but there is nothing like that for e-mail.  If you own your domain name, you can point it to any mail server you want to do business with.