gpt4 book ai didi

asp.net - 如何多行数据来自数据库

转载 作者:太空宇宙 更新时间:2023-11-03 18:26:13 25 4
gpt4 key购买 nike

我正在从我的数据库中检索一篇文章,但它出现在太长的一行中! ,所以我想在我的网页中以多行的方式显示它
我正在使用数据列表元素来接收和显示从 db 检索的数据

 articlesDL.DataSource = DS.select_all_articles();
articlesDL.DataBind();

这就是我的数据列表出现在标签中的内容:

<asp:DataList ID="articlesDL" runat="server">
<ItemTemplate>
<table class="auto-style1">
<tr>
<td class="auto-style2">
<asp:ImageButton ID="ImageButton1" runat="server" Height="50px" ImageUrl='<%# "~/images/"+Eval("imageurl")+".jpg" %>' Width="50px" />
</td>
<td class="auto-style2">
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl='<%# "~/reviewart.aspx?id="+Eval("articleid") %>' Text='<%# Eval("articlebody") %>'></asp:LinkButton>
</td>
</tr>
</table>
</ItemTemplate>

最佳答案

尝试为显示数据的面板设置宽度。

<div ID="articlesDL">

</div>
<style>
#articlesDL
{
width:100%;
}
</style>

关于asp.net - 如何多行数据来自数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20770946/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com