31.05.2009

VRK Controls Tag-Cloud Line-Brake Bug

Today I want to write my first post in english, and in an absolut different category, then I wrote before. First I wanted to open a new blog for this, but why should I? From now, you will see here posts in german and english, and the categories like programming, asp.net, ajax etc. are new.

Maybe you know the free source code of a tag-cloud control for ASP.Net from codeproject. A really nice control, which creates you a word-cloud known from del.icio.us and others. 

If you use this tag-cloud from codeproject, you may run into troubles, if you want to break lines. 
I looked into the source code and found out the misstake. 

What to do, to repair the Tag-Cloud Line-Brake Bug:
  1. Open the source-project VRK.Controls
  2. Open now the file "Cloud.cs"
  3. Go to line "366" and change the code to the following

  1. {
  2.     this.Controls.Add(a);
  3.     this.Controls.Add(new LiteralControl(" "));
  4.     index += 1;
  5. }

  1. Now build the project and use the new .dll for your own project
What was the problem?

If the engine renders the control, it of course makes a space between every control visually, but the html text is without any space. Maybe some browsers are not able to make line-brakes without a real space... So now it works great!

Hope it helps

Blog Archive