More in this section

Forums / Developing with Sitefinity / How to remove the Zero Space Character that Repeaters/ListViews generate?

How to remove the Zero Space Character that Repeaters/ListViews generate?

4 posts, 0 answered
  1. Erik
    Erik avatar
    62 posts
    Registered:
    02 May 2011
    04 Jun 2012
    Link to this post
    See this Stack Overflow thread: http://stackoverflow.com/questions/10882970/how-to-remove-the-zero-space-character-8203-that-asp-repeaters-generate 

    I have a basic repeater that generates an unordered list. Though my markup does not contain the zero space character(
    ​
    ), it is generated preceding each LI in the item template. This little character messes up my design as it adds space between the list items. I have changed this repeater to a RadListView and a list view and have experienced the same result.

    I created a new project to tried to reproduce this issue outside of Sitefinity and could not. Hence why I think Sitefinity is doing it. I am on Sitefinity 5.

    I am about to do a client side hack and just remove the characters with jQuery. The little programmer inside of me would die if I did that though and I would like him not to die. Please help me keep a clear conscience and show me the proper way to remove this character or at least explain to me why some entity has decided to bestow this magical character upon my item template.
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    05 Jun 2012
    Link to this post
    Erik,

    In all seriousness, have you tried completely deleting the block of code and then retyping it? :)

    It seems like a silly solution but I can't count the number of times I've had nonsense appear at the top of PHP files that I've written (which, then, spurt errors all over the place)...nor do I care to admit how much time passes before I'd found a couple of them. lol
  3. Erik
    Erik avatar
    62 posts
    Registered:
    02 May 2011
    06 Jun 2012
    Link to this post
    I have deleted most of it. I opened the file in notepad++ with all characters visible and nothign is there that shouldn't be. This isn't isolated to one file though. It occurs in all the repeaters, list views, and rad list views that I have looked at.
  4. Erik
    Erik avatar
    62 posts
    Registered:
    02 May 2011
    22 Feb 2013
    Link to this post

    Here was my hack to get around this:

    if ($('.my-list').length > 0) {
        $('.my-list').each(function() {
            $(this).html($(this).children('li'));
        });
    }

4 posts, 0 answered