1

I've the following c# code to place a carousel Control inside a Repeater :

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
    <table cellpadding="0" cellspacing="0" class="mycarousel">

            <tr>
                <td valign="top">

                    <a id="prev" class="myprev" href="#">
                    </a>
                </td>
                <td>

                    <div class="carousel_list">

                        <ul class="foo1" id="foo1">
                            <li>
                                <img id="img1" src="<%#Eval("IMG_SRC")%>" />    
                                </a>
                            </li>

                        </ul>

                        <div class="clearfix">
                        </div>

                    </div>

                </td>
                <td valign="top">
                    <a id="next" class="mynext" href="#">
                    </a>
                </td>
            </tr>
        </table>
   </ItemTemplate>  
    </asp:Repeater>
</asp:Content>

CodeBehind :

protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            FillOrder();
        }       
    }

    protected void FillOrder()
    {

        sqlcon.Open();
        sqlcmd = new SqlCommand("select * from Table_1 Order By name", sqlcon);
        da = new SqlDataAdapter(sqlcmd);
        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
        }
        sqlcon.Close();

    }

and here's the result : enter image description here

But what i want / hope to get is this : enter image description here

that means put all names start with "A" into a carousel Control , with "B" into an other carousel Control ...etc

Please can anyone help me in this .

4

1 回答 1

0

我看起来你需要两个中继器控件(一个在另一个里面)。然后你应该准备分层数据结构并绑定它。

于 2013-02-01T16:47:11.593 回答