<asp:DataList ID="show_Area" runat="server" >
            <ItemTemplate>
                 <div>
                    <a onclick="" href="javascript:myclick(<%# Container.ItemIndex %> )"><%#Eval("title") %></a>
                    <span><%# Container.ItemIndex %></span>
                </div>
            </ItemTemplate>
            </asp:DataList>

 

        private void DataList1_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            if ( e.CommandName == "select" )
            {
                DataList1.SelectedIndex = e.Item.ItemIndex;
                BindData();
            }

       }

posted on 2010-12-11 16:33  露水丛生  阅读(555)  评论(0编辑  收藏  举报