简体   繁体   中英

ASP.NET and HTML issue

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??

在此处输入图片说明

实际上,真正的答案是因为我使用的是白色空格过滤器,而这又是在错误的地方删除空格。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM