简体   繁体   English

ASP.NET和HTML问题

[英]ASP.NET and HTML issue

I have a div inside a repeater (ItemTemplate) with the following markup 我在带有以下标记的转发器(ItemTemplate)内有一个div

<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 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. 我正在IE8中查看它,但有人告诉我该页面有时在Firefox和Chrome中损坏。 When viewing the source in IE see line 415 "divclass="bottle listing" 在IE中查看源代码时,请参见第415行“ divclass =“瓶清单”

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. 它解决了这个问题,如果有人能解释为什么它可以解决问题,我很想听听。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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