March 23rd, 2008 — Administration
Last week I installed Windows 2008 Server Standard on one of our dedicated Servers. So far I really like it, IIS7 seems to be pretty nice and the administration features evolved a lot. I also like the improved Remote Desktop, it’s logging in way quicker and feels more smooth than before. The installation itself had been a piece of cake, even the beta drivers of our 3Ware RAID-1 Controller are working flawless. Although we plugged in 8GB of RAM but we can only use 4GB as we have to use the 32-Bit Edition of Windows 2008 Server. Some payment gateways do not provide 64-Bit Software yet and that’s why we had to stick with the rusty 32-Bit bits, but it’s ok.
After setting up a couple of ASP.NET Webs we had to take care about the E-Mail delivery. These days you should carefully choose your Mailserver as the ropes of E-Mail Delivery are very much tightned. So besides of avoiding spam filters with your ASP.NET Application you have to be even more critical about your Mailserver.
Windows 2008 Server comes with a build-in SMTP Service which is still running on old IIS6 bits, that’s one of a couple of services depending on IIS6, so it’s still installed. Comparing the IIS6 and IIS7 Administration-Consoles is like comparing 2 different worlds. After playing a bit around with it I wasn’t able to set it up as a perfect mail delivery service. I think it only works great if you can bump your mails to an external, dedicated SMTP Service. Another drawback is that there’s no POP3 Service anymore coming with Windows 2008 Server. So afterall you need a standalone Mailserver anyway if you want to use POP3.
Not all of us are blessed by having a dedicated Microsoft Exchange Server which is taking care of all the mailing stuff. Installing it on our current Windows 2008 Server system would steal to many resources which are desperately needed for our high traffic webs.
We can’t use Google Apps as they are limiting the outgoing mails to 500 per day (per Account). Of course we could work around that by using several Accounts and run a counter on the sent mails but we wanted to use something bullet proof using just one e-mail address like noreply@domain.com.
Mercury Mailserver is a free standalone Mailserver of the creator of Pegasus Mail. It’s pretty light but offers SMTP, POP3 and even IMAP. Although we ran into pretty heavy DNS problems while using it and it ran somewhat unstable on Windows 2008 Server. Another drawback is that it’s not coming along with a Windows Service, there are some addons for that but it’s just too unstable.
There are a couple of other free Mailservers like hMailServer and Surge but none of them ran stable on Windows 2008 Server, it looks like they’re not compatible yet to the Vista-Like-Architecture.
So we ended up with Kerio Mailserver. It’s already Vista compatible and runs great on Windows 2008 Server. It has a lot of features, in fact more than we needed, but it’s still smaller as Microsoft Exchange. Although it’s also not that cheap, but at least our proper Mail delivery is guaranteed - which is very important for stuff like Activation Mails. The alternative would have been Smartermail which is based on ASP.NET, but we went for Kerio this time as we have had good experiences with it in the past.
If anyone of you guys got additional information or tipps on this topic, feel free to leave a comment! As of know there’s no free Mailserver for Windows 2008 Server available, at least the ones I found didn’t run stable yet.
February 22nd, 2008 — Microsoft
I just read about the bigger, better and faster SkyDrive Release on the SkyDrive Team Blog.
SkyDrive is also available now in 38 countries/regions. In addition to Great Britain, India, and the U.S., we’re live in Argentina, Australia, Austria, Belgium, Bolivia, Brazil, Canada, Chile, Colombia, Denmark, the Dominican Republic, Ecuador, El Salvador, Finland, France, Guatemala, Honduras, Italy, Japan, Mexico, the Netherlands, New Zealand, Nicaragua, Norway, Panama, Paraguay, Peru, Puerto Rico, Portugal, South Korea, Spain, Sweden, Switzerland, Taiwan, and Turkey.
Now seriously guys, Microsoft is pretty big in Germany, why are we always missing cool stuff? Ok, we can use GMail as free Online Storage, but maybe we’d like to stick to Microsoft stuff, too. We can’t use AdCenter and we can’t use SkyDrive in Germany and there are probably lots of other Microsoft Services we can’t use in Germany. Anyone has an explanation for this? I’m clueless.
February 12th, 2008 — Personal
I’m visiting the VSone in Munich, Germany tomorrow. The topics are Visual Studio, .NET and SQL with a focus on the new .NET 3.5 Framework. It will take place in the IMAX Cinema on very big screens. I’ll arrive around 9 AM and I will also visit the party afterwards, which is taking place in the famous Planetarium.
If you happen to be there, feel free to drop me a line via e-mail or add me on Xing!
February 2nd, 2008 — ASP.NET
Just in case you never heard about SubSonic yet, it’s a kickass DAL and I use it for a lot of my projects. Currently it supports SQL Server 2000 or 2005, MySQL and or Oracle (with SQLLite, SQLCE). They also offer a nice Starter-Kit which comes pre-wired with SubSonic, Membership, AJAX, Useful Utilities, and the FCK Editor. It’s based on the .NET 2.0 Framework but it’s automatically being converted by Visual Studio 2008 in case you use v3.5 already (which I strongly recommend).

With v2.1 they shipped a new Query Tool which is now fully capable of creating more complex queries, for example:
Northwind.CustomerCollection customersByCategory = new Select()
.From<Northwind.Customer>()
.InnerJoin<Northwind.Order>()
.InnerJoin(Northwind.OrderDetail.OrderIDColumn, Northwind.Order.OrderIDColumn)
.InnerJoin(Northwind.Product.ProductIDColumn, Northwind.OrderDetail.ProductIDColumn)
.Where(“CategoryID”).IsEqualTo(5)
.ExecuteAsCollection<Northwind.CustomerCollection>();
Read more about the new version here. Check it out, I don’t want to miss it anymore ;).
January 5th, 2008 — ASP.NET
This error eventually pops up, if you use the AjaxControlToolkit Rating Control. The Rating Control just doesn’t work, nothing happens when you click on it or hover over it. You find a couple of threads about it in Google but none of them helped me. I completly rewrote my web.config, removed all HttpModules, checked my Rewrite Logic for possible .axd lockups and nothing helped. That’s the exact error:
WebForm_InitCallback is not defined
Vote.aspx
Line 226
Line 226 says WebForm_InitCallback();Sys.Application.initialize();.
After wasting about 4 hours I checked out the CSS definitions which are being used by the Rating Control:
StarCssClass="ratingStar"
WaitingStarCssClass="waitRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar"
I checked the path to the images set in those 3 CSS definitions and noticed that waitRatingStar was pointing to an invalid path - a non existing image. After fixing that path the error was gone!
Like so many times a trivial fault can cost you lots of time - and the error which is being thrown by this fault unfortunately really doesn’t point you into the direction of a missing image. Hopefully this saves someone else searching time on this ;).
December 22nd, 2007 — ASP.NET
BBCodes are well known through forum communities and is the abbreviation for Bulletin Board Code. The tags are usually indicated by rectangular brackets surrounding a keyword, the use of it is to make text formatting possible without having to write HTML. It’s safer, comfortable and easy to implent.
Every tag is being translated into markup language that web browsers understand, this is where Codeparser.NET joins the game:
codeparser.net is a free .NET based and highly configurable parser for BBCode. Since it is a component, it can be integrated with Windows as well as with web applications and web services.
It’s pretty easy to implent and you will find some pre-made examples for parsing Smilies, Lists, Links, Code and much more. Alternative replacements, syntax highlighting, invalid tag configuration, expression replacements, things you don’t want to miss when dealing with BBCodes. I recently used it for two ASP.NET Web Applications, it’s pretty straight forward. Define some rules, save them as parser.xml, create the parser object and just starting parsing:
parser.Parse(txt);
If you use the dll for communities there’s just one thing to look after, people forget closing specific tags sometimes which will lead to an exception at the moment. One of the developer, Golo Roden, already told me that they are working on a better solution for this in a future version, for now just use a try/catch block if you deal with user input and do not validate the proper tag closings yourself:
protected string ParseText(string txt)
{
try
{
return parser.Parse(txt);
}
catch
{
return txt;
}
}
Here is a example of a parser.xml which is parsing Links and text formattings:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<parser>
<throwExceptionOnInvalidTag value="False" />
</parser>
<tags>
<tag name="url" replacement="<a href="{1}">{0}</a>"
alternativeReplacement="<a href="{0}">{0}</a>" />
<tag name="mail" replacement="<a href="mailto:{1}">{0}</a>" />
<tag name="email" replacement="<a href="mailto:{1}">{0}</a>" />
<tag name="b" replacement="<span style="font-weight:bold;">{0}</span>" />
<tag name="i" replacement="<span style="font-style:italic;">{0}</span>" />
<tag name="u" replacement="<span style="text-decoration:underline;">{0}</span>" />
<tag name="quote" replacement="<table border="0" cellpadding="8" cellspacing="0"><tbody><tr><td class="alt2" style="border: 1px inset ;">{0}</td></tr></tbody></table>" />
</tags>
</configuration>
I didn’t face any other problems after running it for about one month now, good job and I’m happy to recommend it to you guys! Head over to the Codeparser.NET homepage for more.
December 5th, 2007 — ASP.NET
Just released: Telligent (Creators of CommunityServer) Graffiti CMS - Beta 1, and believe me or not but I was able to set it up in about 20 seconds! This even beats the famous Wordpress 5 Minutes installation. I installed it using an Access Database which is included containing some sample data. For small sites this works great, for bigger sites you want to use the SQL Server as datastorage.
The interface is pretty simple and fast, nevertheless, you probably notice some similarities to Wordpress ;). It can be used for blogging, smaller content websites or even bigger projects are imaginable.
This could become the new ASP.NET Wordpress.. or even more! With the power of ASP.NET it has great potential. It even has SEO friendly URLs included, out of the box of course! The functionality for tagging, categories, plugins, themes and all the stuff you need for starting through are also included.
As far as I know there will be two versions, one free version which runs on Access and one commercial version which runs on SQL Server.
Check it out, it’s really worth a try! I included some screenshots at the end of this post.

Download: Graffiti Beta 1.

December 1st, 2007 — ASP.NET
Microsoft just released the Customer Technology Preview (CTP) of Web Deployment Projects for Visual Studio 2008. It contains all the features that VS 2005 WDP release has and in addition has few other enhancements.
For example it only deletes the existing web now if the build succeeds, this will pretend breaking running IIS Applications if you used to deploy directly into the specific IIS Application folder. Additionally you can automatically create virtual Folders in IIS or replace existing ones - this works for IIS6 and IIS7.
Also nice to know is, that aspnet_merge is being automatically installed now when you install Visual Studio 2008. It’s placed in “%Program Files%\Microsoft SDKs\Windows\v6.0A\bin and of course WDP depends on it if you use the merge feature.
Get the December CTP 2007 here: VS 2008 WDP December CTP 2007.
November 23rd, 2007 — ASP.NET
You were using LINQ and Visual Studio 2008 Beta 2? Switched to Visual Studio 2008 RTM and out of nowhere this error pops up? Lucky you, this one will be pretty easy to fix:
- Open up your DBML File.
- In the first line, switch the encoding from utf-16 to utf-8.
That’s it once again! I hope you enjoyed another RTM quick fix .. 
November 23rd, 2007 — ASP.NET
Now this is even more tricky than An item placeholder must be specified on ListView. For Visual Studio 2008 RTM Microsoft changed the whole GroupTemplate Design structure.
This MSDN Article is covering it pretty good, here’s what you have to do if you switched from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM:
1) Remove the ItemPlaceholderID=”xx” from your ListView, it should look like that (e.g.):
<asp:ListView ID=”ListView1″ runat=”server” DataKeyNames=”picID” DataSourceID=”LinqDataSource1″ GroupItemCount=”4″>
2) Have a LayoutTemplate organized like that:
<Layouttemplate>
<table align=”center” border=”0″ cellpadding=”15″ cellspacing=”15″ id=”layoutTemplate” runat=”server”>
<tr runat=”server” id=”groupPlaceholder” />
</table>
</Layouttemplate>
3) And a GroupTemplate in that kind of style:
<GroupTemplate>
<tr runat=”server” id=”ProductsRow”>
<td runat=”server” id=”itemPlaceholder” />
</tr>
</GroupTemplate>
That’s all. If you try to set the new GroupPlaceHolderID in the ListView Tag the GroupTemplates won’t be formated correctly, I didn’t figure out why yet. This solution however is based on the MSDN Article and works.
November 23rd, 2007 — ASP.NET
This errors pops up as soon as you switched from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM. Here’s the exact error:
System.InvalidOperationException: An item placeholder must be specified on ListView ‘ListView1′. Specify an item placeholder by setting a control’s ID property to “itemPlaceholder”. The item placeholder control must also specify runat=”server”.
To fix this, replace every itemContainer occurrences with itemPlaceholder, recompile and it should work. Also note that the control which is targeted as itemPlaceholder does not render CSS or other attributes anymore, you have to set them on surrounding HTML tags now like a div or ul.
November 19th, 2007 — ASP.NET, Development
There we go, Visual Studio 2008 Final has just been released, including the .NET Framework 3.5 Final Version.
Here are some instructions for the Install-Process from Scott Guthrie, especially if you were using VS2008 Beta 2:
People often ask me for suggestions on how best to upgrade from previous betas of Visual Studio 2008. In general I’d recommend uninstalling the Beta2 bits explicitly. As part of this you should uninstall Visual Studio 2008 Beta2, .NET Framework Beta2, as well as the Visual Studio Web Authoring Component (these are all separate installs and need to be uninstalled separately). I then usually recommend rebooting the machine after uninstalling just to make sure everything is clean before you kick off the new install. You can then install the final release of VS 2008 and .NET 3.5 on the machine.
Once installed, I usually recommend explicitly running the Tools->Import and Export Settings menu option, choosing the “Reset Settings” option, and then re-pick your preferred profile. This helps ensure that older settings from the Beta2 release are no longer around (and sometimes seems to help with performance).
Note that VS 2008 runs side-by-side with VS 2005 - so it is totally fine to have both on the same machine (you will not have any problems with them on the same box).
I really hope the final Release will fix some annoying bugs I was fighting with lately, although I expect this to be a much smoother release than Visual Studio 2005.
Quick Note to Silverlight Developers: You should wait until Microsoft released the updated Silverlight Tools for VS 2008, it’s expected within the next two weeks.
Futhermore Microsoft released a cool Training-Kit for the .NET Framework v3.5, grab it here. The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management.
November 17th, 2007 — Administration
I got my new BlackBerry Curve 8310 today and honestly already expected to experience problems when trying to run it on Windows Vista.
So here’s what you have to do to properly install the BlackBerry Desktop Manager 4.3 and your BlackBerry Device:
- Install the BlackBerry Desktop Manager 4.3, be sure to download the latest Version here. I’m using 4.3.0.15 (Auguest 2007)
- After the installation don’t reboot your PC and do not start the Desktop Manager yet
- Plug your BlackBerry in by using the supplied USB Cable
- Now the important part: Vista will tell you it found new hardware but no proper driver for it. Choose to manually search for a driver, type in C:\ and hit enter.
- This will occur several times, just proceed with C:\ and enter.
- After about 5 times you should be done, now you should be able to start the Desktop Manager and use your BlackBerry.
If you don’t do it that way, the Desktop Manager will detect your BlackBerry phone but it won’t be able to work with it, the connection will always fail when you try to use the Synchronizing Service or the Backup/Restore Manager.
Furthermore you should update your BlackBerry Device Software, for T-Mobile Germany go here to download the latest Firmware: BlackBerry Device Software Downloads. Thanks to Quintt for the comment!
November 10th, 2007 — ASP.NET
I recently built an ASP.NET Application which makes intensive use of the build in ASP.NET Membership Class. I use it to store the number of new messages for a particular user and stuff like that as it’s very comfortable to set those values:
System.Web.Profile.ProfileBase pB = System.Web.Profile.ProfileBase.Create(UserName); pB["FriendApproval"] = ApprovalCount.ToString();
pB.Save();
I use the LastActivityDate Value to show members who have been around recently. The strange thing had been that every now and then members popped up on the top who actually haven’t been online at all.
That happens because the LastActivityDate Value is updated on every Profile Info retrieval and every Profile Info Update by default. To disable this behavior you have to modify two Stored Procedures:
aspnet_Profile_GetProperties
Remove this piece of code:
IF (@@ROWCOUNT > 0)
BEGIN
UPDATE dbo.aspnet_Users
SET LastActivityDate=@CurrentTimeUtc
WHERE UserId = @UserId
END
aspnet_Profile_SetProperties
Remove or comment out this piece of code:
UPDATE dbo.aspnet_Users
SET LastActivityDate=@CurrentTimeUtc
WHERE UserId = @UserId
That’s it! Of course you have to take care of updating the LastActivityDate yourself now, I recommend adding a User Control to the MasterPage, put the Stored Procedure for Updating LastActivityDate (write one) in its codebehind and cache the control for about 5 Minutes, your server will thank you later.
October 25th, 2007 — ASP.NET
Last week I read a great post on Mad’s Blog about Re-Enable Request Validation in ASP.NET. He built a javascript function which automatically HTMLEncodes the Text on Clientside when the User hits Submit by using Tagmapping and automatically HTMLDecodes it on server-side.
By using his technique you can still benefit of the ValidateRequest Security while allowing HTML in your forms.
Now to the Follow Up: If you use ASP:Panels on your webform and you hide specific Panels which do include Textboxes to show them just on specific events you run into a Javascript Error saying tb is null. That’s because the HTML Output which is dynamically created doesn’t contain the textbox when the Panel is hidden, although ASP.NET is executing the JS Statement for those hidden textboxes anyway and that’s when the Error pops up. You can fix that pretty easy by checking if tb is null, here’s Mad’s Code containing that little fix:
public class SafeTextBox : System.Web.UI.WebControls.TextBox
{
protected override void OnLoad(System.EventArgs e)
{
base.OnLoad(e);
if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "TextBoxEncode"))
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("function TextBoxEncode(id)");
sb.Append("{");
sb.Append("var tb = document.getElementById(id);");
sb.Append(”if (tb != null){”); //fix
sb.Append(”tb.value = tb.value.replace(new RegExp(’<’, ‘g’), ‘<’);”);
sb.Append(”tb.value = tb.value.replace(new RegExp(’>’, ‘g’), ‘>’);”);
sb.Append(”}”);
sb.Append(”}”);
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), “TextBoxEncode”, sb.ToString(), true);
}
// Adds the function call after the form validation is called.
if (!Page.IsPostBack)
Page.Form.Attributes[”onsubmit”] += “TextBoxEncode(’” + ClientID + “‘);”;
}
public override string Text
{
get { return base.Text; }
set
{
if (!string.IsNullOrEmpty(value))
base.Text = value.Replace(”<”, “<”).Replace(”>”, “>”);
else
base.Text = value;
}
}
}
Read Mad’s full article on how to implent this technique and be sure to turn ValidateRequest back on!