Do you know the kind of guy who thinks viruses only effect people who don’t know what they are doing and because of that never felt the need to install an anti-virus/malware/spyware program? That guy is me. I’ve never had a virus before and therefore never had an anti-virus program either. Why should I? They slow down your machine and are just annoying and as long as I’m not stupid enough to get a virus, all is good.

Then it happened. Yesterday. I got my first virus and I have no idea from where. It’s not directly malicious but it changes my internet settings and I keep getting a popup saying “Windows security warning, click yes to download an anti spyware program”. I of course click no, because something doesn’t smell right.

I know that I’ve never had a virus because I occasionally run the online Panda ActiveScan or the Trend Micro HouseCall. They both run in the browser and have never found virus on any of my machines ever. Right now, I run the Trend Micro to get rid of the pesky intruder.

I’ve always been proud to say that I’ve never had a virus, so the fact that I finally got one leaves me ashamed and angry for allowing it to do whatever it does. There goes my perfect track record.

So the question now becomes whether or not I want to install an anti-virus program to prevent future attacks. It would be the logical thing to do I presume. Well, think of it in another way. If you walked the same streets for 5 years to and from work and suddenly fell on the pavement and hurt your knee, would you then start wearing knee pads? Definitely not. It would be to admit being stupid and count on it to happen again soon because of my own recklessness.

What I’ve learned is that I have no problem getting a virus every five years, but I’ll bet the feeling of shame will be equally big next time in 2012. I’ll write another post about it then.

In the upcoming version of BlogEngine.NET it is now possible to embed standard ASP.NET user controls into the body of a post. We did this because a lot of people have built various user controls over time and it would be a shame not to be able to use them on a blog. This allows developers to put polls, forms and other cool stuff inside a blog post just by creating an .ascx user control.

The injection

Now, let’s say you have a user control called poll.ascx and want to inject it in the middle of the text of a blog post. The poll.ascx file is located in your theme folder, but could be located anywhere. To inject it you just type the following into the editor:

When the post is served it looks for any references to user controls, like the one above, and renders them inside the post. The only limitation is that postbacks will screw up the comment form. Therefore it is suggested that you use AJAX in the form of client-callbacks instead of postbacks. It doesn’t make sense to use postbacks anyway, because that would scroll the page to the top and that is very bad usability.

By injecting user controls in a post you can also place Google ads where ever you want. Just stick your Google JavaScript code in a user control and reference it. This can also be done using the extension model, but might be easier to modify.

I’m very excited about this feature because I can’t imagine all the possibilities it provides to BlogEngine users and what cool controls will be created. The 1.2 version is being released later this September.

Use custom web pages

If you want to create a custom web page instead of injecting user controls, you can still do that the same way as usual. Just place your custom .aspx page in the root and make it inherit from BlogEngine.Core.Web.Control.BlogBasePage instead of System.Web.UI.Page. When doing that it automatically loads your theme and master page around the page. You can then keep the look and feel of your theme, but totally control the content and functionality of your custom page.