asp.net网站前台通过DataList展示信息的代码

//aspx页面中

<asp:DataList ID="dlZP" runat="server" CssClass="hong">
                                            <ItemTemplate>
                                                <table align="center" cellpadding="0" cellspacing="0" width="266">
                                                    <tr>
                                                        <td>
                                                            <span class="hong" style="color: #000000">·<a class="huise" href="#"
             onClick="window.open('ShowLeaguerInfo.aspx?id=<%#DataBinder.Eval(Container.DataItem,"id") %>','','height=258, width=479, top=200, left=200')"><%#DataBinder.Eval(Container.DataItem,"title") %></a></span></td>
                                                    </tr>
                                                    <tr style="color: #000000">
                                                        <td>
                                                            <img height="1" src="images/line.gif" width="266" /></td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:DataList>

//cs文件中

 if (!IsPostBack)  //!IsPostBack避免重复刷新加载页面
        {
            //获取前6条分类供求信息
            dlZP.DataSource = operation.SelectLeaguerInfo(true, "公司公告", 6);//dlZP与前台的id相同
            dlZP.DataBind();
         }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值