2

I have a div inside a repeater (ItemTemplate) with the following markup

<div class="bottle listing">

Now for some reason this is being rendered as

<divclass="bottle listing">

Which breaks the page. This is only occurring infrequently and I haven't been able to nail down if it is only occurring in some browsers. Check out this site please:

http://www.myerwine.com.au/whites/chardonnay/4/16.aspx?page=2

I am viewing it in IE8, but I have been told this page is sometimes broken in Firefox and Chrome. When viewing the source in IE see line 415 "divclass="bottle listing"

Here is a portion of my repeater:

<asp:Repeater ID="repResults" runat="server" OnItemDataBound="repResults_DataBound">
    <ItemTemplate>
        <div class="row listing">
            <div class="bottle listing">
                ............
            </div>
        </div>
     </ItemTemplate>
 </asp:Repeater>

Any ideas??

enter image description here

9
  • 2
    Posted the code that is outputting: <div class="bottle listing">. Commented Dec 13, 2012 at 0:09
  • I suggest that you chack your code in html validator. validator.w3.org Commented Dec 13, 2012 at 0:14
  • I have used a validator and it doesn't find the broken element. However firefox correctly renders this page (for me) Commented Dec 13, 2012 at 0:19
  • I see the problem in FF. You need to post the code from the repeater's item template. Commented Dec 13, 2012 at 0:24
  • 1
    Is it significant that it's only the first div in your repeater that happens on, the rest of the repeated divs emit correct html. What happens if you add two spaces or other attributes to that div? Commented Dec 13, 2012 at 0:38

2 Answers 2

1

Actually the real answer was because I was using a White space filter and that in turn was removing spaces in the wrong places.

Sign up to request clarification or add additional context in comments.

1 Comment

Well... that would certainly do it.
0

I added a second space

<div  class="bottle listing">

And it fixed the problem, if anyone can explain why this solved the problem I would love to hear it.

1 Comment

Could be your IDE or version control, or Mac - Windows conversions that get rid of the space character there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.