开发者

error asp:Literal change position tag html after assign value?

    <asp:Literal ID="literal" runat="server"  >
         </asp:Literal>

i using string have value below

<div class="TopNewsTab">
    <div class="news-category">
        <div class="c1">
            <div class="c11">

            </div>
            <div class="c12" />
            <div class="c13" />
        </div>
        <div class="news-content">
        </div>
     </div>

    <div class="news-category">
        <div class="c1">
            <div class="c11">

            </div>
            <div class="c12" />
            <div class="c13" />
        </div>
        <div class="news-content">
        </div>
     </div>

</div>

after i using literal.Text= valueover;

when display on page i used firebug see content become

<div class="TopNewsTab">
    <div class="news-category">
        <div class="c1">
            <div class="c11">

            </div>
            <div class="c12" />

             **<div class="news-category">
                 <div class="c1">
                   <div class="c11">

                  </div>
                  <div class="c12" />
                  <div class="c13" />

              </div>**

        <div class="news-content">
        </div>
     </div>
        <div class="c13" />
开发者_StackOverflow        </div>
        <div class="news-content">
        </div>
     </div>

</div>

position of <div class="news-category"> change position before assign literal please help me the problem ??


Don't self close your <div/> tags. I know it seems like it should technically be valid in XHTML, but it causes problems.

So just change

<div class="c12" />
<div class="c13" />

to

<div class="c12" ></div>
<div class="c13" ></div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜