日期:2014-05-17  浏览次数:20437 次

绑定后数据后设置div的class属性
C# code

 <table border="0" cellspacing="0" cellpadding="0" width="96%">
                            <tbody>
                                <tr>
                                    <td height="33" align="left">
                                        <div class="bottomNewsTitle">
                                            <ul>
                                                <asp:Repeater ID="rtitle" runat="server">
                                                    <ItemTemplate>
                                                        <li class="ti tle_Off" id="titleT<%# Container.ItemIndex %>" onmouseover="PanShow('title',<%# Container.ItemIndex %>,3)">
                                                            <%#Eval("Nclass")%></li>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

运行生成后的html如下:
<table border="0" cellspacing="0" cellpadding="0" width="96%">
                            <tbody>
                                <tr>
                                    <td height="33" align="left">
                                        <div class="bottomNewsTitle">
                                            <ul>
                                                
                                                        <li class="ti tle_Off" id="titleT0" onmouseover="PanShow('title',0,3)">
                                                            综合考评</li>
                                                    
                                                        <li class="ti tle_Off" id="titleT1" onmouseover="PanShow('title',1,3)">
                                                            中学教育</li>
                                                    
                                                        <li class="ti tle_Off" id="titleT2" onmouseover="PanShow('title',2,3)">
                                                            小学教育</li>
                                                    
                                                        <li class="ti tle_Off" id="titleT3" onmouseover="PanShow('title',3,3)">
                                                            幼儿教育</li>
                                                    
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>


绑定后所有class的属性都为ti tle_Off
  <li class="title_Off" id="titleT0" onmouseover="PanShow('title',0,3)">

现在我是想在绑定后让第一个class属性改为title_on
如下

 <ul>
   
  <li class="title_on" id="titleT0" onmouseover="PanShow('title',0,3)">
  综