如何在asp.net中更改标签数据流.. [英] how to change label data flow in asp.net ..

查看:71
本文介绍了如何在asp.net中更改标签数据流..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我想把标签数据停在多行..但我的标签现在正常工作....所以请帮助我..我在很多方面尝试过..为什么它不起作用??< br $> b $ b



我的代码是:



style type =text / css >

.lbl_aldata {

text-align-last:justify;

宽度:200px;

显示:内联块;

浮动:左边;

}

< / style>



 <   asp:DataList     ID   =  dl_imgalbums    runat   =  server      RepeatDirection   = 垂直     高度  =  540px   宽度  =  100%    OnSelectedIndexChanged   =  dl_imgalbums_SelectedIndexChanged >  
< ; ItemTemplate >
< div id = div_imgalbumback >
< asp:HiddenField < span class =code-attribute> ID = hfPhotoID runat = server =' <% #Eval( DefaultPhotID)%>' / >
< class = auto-style1 >
< tr >
< td >
< div id = div_albumimg >
< a href =' <% Photos.aspx?AlbumID = + Eval( < span class =code-string> AlbumID)%>' >
< asp:Image CssClass = img_galalbum runat = server ID = imPhoto ImageUrl =' <% ThumbNail.ashx?ImURL = + Eval( 照片)%>' / >
< / a >
< / div >
< / td >
< td > <% - < div id =div_databack> - %>

< table class = auto-style1 >
< tr >
< td > < asp:标签 ID = lblAlbumName CssClass = lbl_albumname runat = s erver 文字 < span class =code-keyword> =' <% #Eval( AlbumName)%>' > < / asp:标签 > < / td >
< / tr >
< tr >
< td style = width:200px; > < asp:标签 ID = lbl_aldata runat = 服务器 文字 =' <% #Eval( < span class =code-string> AlbumDescription)%>' >

< / asp:标签 > < / td >
< / tr >
< / table >

<% - < / div> - %>

< / td >
< / tr >
< / table >


< / div >
< ; / ItemTemplate >
< / asp:DataList >

解决方案

如果您的标签长度​​超过200px,它将自动进入下一行。



所以,改变宽度:200px到宽度:自动或宽度:100%。



(宽度:100% - 如果使用此宽度,标签尺寸将根据设备长度自动调整)



它不会影响表大小或表格单元格大小。



所以,试试这个方法吧。希望这可以帮助。



请不要忘记投票给这个答案.. :)



新年快乐!!

hi friends i want to stop the label data into multiple lines ..but my label now working properly ....so please help me..i am tried in many ways ..why it is not working ..?


my code is :

style type="text/css">
.lbl_aldata {
text-align-last:justify;
width:200px;
display:inline-block;
float:left;
}
</style>

<asp:DataList ID="dl_imgalbums" runat="server"  RepeatDirection="Vertical"  Height="540px" Width="100%" OnSelectedIndexChanged="dl_imgalbums_SelectedIndexChanged">
<ItemTemplate>
    <div id="div_imgalbumback">
         <asp:HiddenField ID="hfPhotoID" runat="server" Value='<%# Eval("DefaultPhotID") %>' /> 
                <table class="auto-style1">
            <tr>
                <td>
                    <div id="div_albumimg">
                        <a href='<%# "Photos.aspx?AlbumID="+Eval("AlbumID") %>'> 
                    <asp:Image CssClass="img_galalbum" runat="server" ID="imPhoto" ImageUrl='<%# "ThumbNail.ashx?ImURL="+Eval("Photo") %>' />
                    </a>
                    </div>
                </td>
                <td> <%--<div id="div_databack" >--%>

                    <table class="auto-style1">
                        <tr>
                            <td><asp:Label ID="lblAlbumName" CssClass="lbl_albumname" runat="server"  Text='<%# Eval("AlbumName") %>'></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="width:200px;" ><asp:Label ID="lbl_aldata" runat="server" Text='<%# Eval("AlbumDescription") %>'>

                                 </asp:Label> </td>
                        </tr>
                    </table>

                  <%--  </div>--%>

                </td>
            </tr>
        </table>


    </div>
</ItemTemplate>
</asp:DataList>

解决方案

if your label length exceeds 200px it will automatically come to next line.

so, Change the width:200px to width:auto or width:100%.

(width:100% - if you use this width, the label size will be automatically adjust based on the device length)

It will not affect the table size or table cell size.

So, try this method. hope this helps.

Please don't forget to vote this answer.. :)

Happy new year!!


这篇关于如何在asp.net中更改标签数据流..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆