.NET and Open Source: better together

RTur.net

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Extension Manager for BlogEngine

BlogEngine has excellent extensibility model, core libraries expose any significant event you can think of to the outside world and you can subscribe to this events from your code and get access to the posts, pages, comments, files etc. And it does not take a lot to write extension – all you need is to decorate your class with [Extension] attribute. On application load BlogEngine uses reflection to lookup types in the compiled assembly and, if class decorated as extension, BE creates instance of this class. Here is a code from Global.asax that does just that: More...

Ajax: the Microsoft way

Second part of my Ajax adventure was rather boring; I simply wrote standard ASP.NET application and added couple update panels to ajaxify it. This app is similar to the first one, except it writes/reads to XML instead of flat file and works specifically with links. I didn’t even need second page or service to send request to, code-behind served this purpose just fine. And this is where Microsoft Ajax strength is – it lets you write your C#/VB code and don’t worry too much about JavaScript. Well, it is to say if you doing it the easy way. You can go whole nine yards with web services and end up with totally different architecture (SOA is another buzz word) if you want to do it the right way, but it is kind of out of scope in my little research. Anyways, here is my conclusions (ok, I admit, it is crazy to make conclusions after next to nothing experience, but I’ll do it anyway; I’ve seen countries going to war with less research on their hands; my conclusions will harm no one). More...

Doing Ajax using client callbacks

Yes, I've heard about Ajax before - one would have to be hiding in the hole for the last year or two to avoid the buzz. I've read articles, seen videos and presentations, even used applications that utilize Ajax on a daily basis. So I’m not exactly a newbie. But somehow I managed to stay away from it - no projects I've been involved into for the last few years used Ajax. I decided it is a shame and I want to change it. Here is a plan: for starters I'll write two small applications ("gadgets", or user controls, for BlogEngine). The first one will be using "classic" JavaScript callback approach and the other one will be doing similar stuff the Microsoft way. Then I will compare experience. Sounds fair? More...

VS 2008 and .NET 3.5 are out

Every time someone tells how powerful today’s computers are and how one should always trade performance for good architecture, testability and thousand other great things - I want to hit guy on the head. And I'm not a violent person. It just sucks to right click in the windows explorer and wait 20 seconds before context menu shows up or get "calculating remaining time" when trying to copy files around (yes, I'm still getting those in my all powerful Vista occasionally). Apparently, today’s computers have so much power that they can't concentrate on such minuscule tasks, and processor has to do complicated calculations in the background just to keep itself entertained. More...

BlogEngine and ASP.NET AJAX

As you can read on official site, BlogEngine does support Ajax. The approach it uses - it relays on few simple helper JavaScript routines (can be found in BlogEngine.Core/Web/Scripts/blog.js) and hand-crafter JavaScript functions in the UI code to perform basic callbacks. BlogEngine does not support Ajax.Net (aka Atlas or ASP.NET 2.0 AJAX Extensions in its latest incarnation) out of the box, and for a good reason. Ajax.Net is a dependent technology. You can't just throw Ajax DLLs in the /Bin folder and hope it will work - most likely it won't. The reason is that Microsoft's Ajax libraries require full trust to run, and if this is fine on your local machine, where you can grant yourself all rights in the world, your host might (and should) be far less generous. More...

Insert Code - your options

Code Formatter extension

For those who use BlogEngine as a technical blog (which is pretty common at this stage) code formatting feature is a must. Sure, you can squeeze your code in between “pre” tags and you are done – well, almost – editor will probably remove most of the white spaces and you’ll have to add some non-braking-spaces instead. But if you want coloring and nice formatting you’ll need more than that. There are several options to explore, and most obvious one is BlogEngine’s code formatter extension that comes with installation bits. To use extension you simply enclose your code within square-bracketed tags and specify what language you are going to format. If you do it from Tiny MCE rich box editor, it will add “p” and “pre” tags automatically for you, if you prefer doing it from HTML view you’ll have to add some tags manually, as shown in the picture on the right. Because Tiny MCE has a habit of re-formatting your HTML, based on your configuration results might vary and sometimes not be pretty. And you may not use Tiny MCE at all – if you replaced it with another editor. So you might run into problems using formatting extension, lots of people do (based on discussions in the BlogEngine's forum). No worries – there always more than one way to skin the cat! More...

Going Vegas

Don’t be jealous – I haven’t had real vacation for more than three years now, since my kids were born. These few days in Vegas are well deserved! I’m leaving early Saturday and will be back Wednesday, hopefully in one piece and not much poorer. And I’ve done everything I’ve promised: Dark Blog is up and running and Mp3 Player got face lift and don’t choke in IE any more. What more do you want? No, seriously…

In case you didn’t notice, I “enhanced” this site with SnapShots. If it annoys you too much, you can easily turn it off by opting “disable” in the upper right corner any pop-up that jumps when you hover over some of the links (you’ll have to delete cookies to re-enable it again if you’ll get bored afterwards). I can turn it off all together if you’ll start complaining, but so far I’m more like having fun with these little guys. It took about five minutes total to register and set it up, so if you are into this kind of things go ahead and add it to your own blog, it is really that simple. More...

Mp3 Player - the new release is coming

Since BlogEngine finally got its extensions section up and running on the project’s home page, I put my Mp3 Player extension up there. Also I’ve been pointed on a small glitch this player has – in IE you have to click once to activate it and only after second click it will play. Not a big deal and I did not pay a lot of attention to it, mostly because pretty much every flash player I used so far has this same problem (see the picture). After short investigation I found out that reason Microsoft can’t fix this glitch is a legal one – there is a dispute over a patent going on. But MS (and Flash people) do provide works around “click to activate” problem, most of which comes down to writing “object” tag by JavaSript rather than embedding it directly into HTML code. Can be done in variety of ways for different situations and I think I found one that will work in my case. Needs a bit more testing, but looks like it should work just fine. More...

DarkBlog is ready for download

That was busy weekend – Saturday I went to see amateur AIBA World Boxing Championship, and it took almost all day (finals in all categories from 48kg up to heavyweights). I used to box (and kick) myself, so it was really exiting to dive into it again, it has special atmosphere around it I really like a lot, special sort of excitement. And I play soccer games on Sunday’s – so I was dragged out of cyberspace into reality for a wile :)

But I did manage to finish BlogEngine’s theme I’ve been working on lately, so you can download and try it if you are interested – I added a page for it in the menu bar, or just click this link.

Throwing a punch

Just read a great article at coding horror on becoming a good blogger. It says that it takes at least a year to even get noticed and main peace of advice is to keep punching and feel good about it. Well, it sounds… hmmm… encouraging. Thanks God I’m not aiming that high. Anyways, I decided to follow advice and throw a punch – even though my new shiny theme for BlogEngine is not quite ready yet and I was hoping this will be my next subject. Funny how it goes – takes about an hour to convert any CSS template into BlogEngine theme, this is how simple it is and how good ASP.NET overall and BlogEngine in particular implemented skinning. Almost too good to be true – and it isn’t. Dirty little secret is that it takes ten times more to polish it to the dissent “production” state, when it looks good in all major browsers and scales fine for reasonable range of screen resolutions. I’ve heard that there are about ten testers for every developer in Microsoft – totally makes sense! More...