I don't want no stinkin <span>

by joey.westcott 26. March 2009 15:34

Goal:
The label control adds <span> tags around the text when rendered, I needed to have these removed. I also show how to replace the <span> tag with whatever tag you would like.

I currently work on a site that has a custom built CMS, which is not always a good thing.  Now don't get me wrong there are some great ideas in this home grown CMS, but just like any application there are some wrong/bad things as well.  Here is one of those bad things that I had the time to fix recently. 

The web site content is entered via a WYSIWYG editor by whoever is responsible for the content, this markup (from the WYSIWYG) is stored in the database along with flags/keys that determine when to display this content.  If a few content items score the same then they all get built together, each one in its own Label control.  This is all fine and dandy, but when it comes time to dynamically create this content and add it to the current page is when they go less than ok.  Because of some limitations of the rest of the framework the content has to be built inside a System.Web.UI.WebControls.WebControl, ok this is fine except we are limited to a select few controls that fall into that category.

More...

Currently rated 3.8 by 4 people

  • Currently 3.75/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Development | .Net | Work

Category List bug in BlogEngine.Net 1.4.5.0

by joey.westcott 21. September 2008 11:17

I recently changed the layout of some of my categories in BlogEngine.Net 1.4.5.0.  In short I wanted to add a few parent Categories for the categories that I was already using.  For example: I have a category name ".net" that I lump all of my .net related items in but what if I also have some java code or C++ code and I have a category for them as well?  To me it makes sense to have a parent category called "development" and then if I want to view all code or development related items including C#, VB, Java, HTML, C/C++ then all I have to do is click on the new parent category and voila you have everything development related no matter what the sub-category is.

So for the bug:
When the Category List control/widget is rendered it looks at the Category.FullTitle to build the URI. This works fine if you are not a sub-category, like ".net" using the example above, but when rendering the URI for these sub-categories its using the FullTitle which is a concatenation of the parents categories and the title of the sub-category: ie: "development - .net".  This does not work and that link should really just be to the ".net" category. So here is the simple code fix that I used, but take in mind that you could also make it so that "development - .net" works.  I just found a quick and easy fix...

Code fix after the break.
More...

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Development | .Net

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen