DataList 中 HyperLink传递时多个参数怎么绑定

 HyperLink传递一个值很好说,但是传递两个值是怎么传的呢?

<asp:DataList ID="DataList1" runat="server" Width="250px" RepeatColumns="2" RepeatDirection="Horizontal">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td colspan="2" style="text-align: center">
                                ☞<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#System.String.Format ("~/everyNews.aspx?newsID={0}&arTypeID={1}",Eval("newsID"),Eval("arTypeID"))  %>' Text='<%# Eval("newsTitle")%>'></asp:HyperLink></td>                 
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:DataList>

顺便也说一下HyperLink传递一个值的写法

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "user.aspx?userName="+Eval("userName") %>' ImageUrl='<%# Eval("pic") %>' Text='<%# Eval("userName") %>'></asp:HyperLink>

posted @ 2010-12-27 11:57  haiziguo  阅读(355)  评论(0编辑  收藏  举报