初学asp.net
在51aspx下了一个开源的项目打算边修改边学
在后台那里模仿登陆和修改用户密码功能都成功
但是在查询用户列表的时候用的asp:Repeater就不显示数据了,项目自己的列表就能出来,我模仿的后台用户列表就出不来了,后台代码那里SQL语句是没有问题的,在数据库里能查出数据。但是asp:Repeater里面我查看源代码却只有input,不见循环出来的表格
aspx文件
- HTML code
<form id="form1" runat="server"> <div> <asp:Repeater ID="rptList" runat="server"> <HeaderTemplate> <table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="31" background="../images/d2.jpg"><table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="5%"><div align="center"><STRONG>序号</STRONG></div></td> <td width="18%"><div align="center"><STRONG>权限</STRONG></div></td> <td width="41%"><div align="center"><STRONG>用户名</STRONG></div></td> <td width="38%"><div align="center"><STRONG>操作</STRONG></div></td> </tr> </table></td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/x1.jpg"> <tr onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#FFFFFF'"> <!-- <tr bgcolor="#F3F7FA" onmouseover="this.bgColor='#D6DD2F'" onmouseout="this.bgColor='#F3F7FA'"> --> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="5%" height="38" class="p12d2"><asp:Label ID="lb_id" runat="server" Text='<%# Eval("Id")%>' Visible="False"></asp:Label></td> <td width="18%"><%# Eval("UserType").ToString().Trim() == "1" ? "<span>超级管理员</span>" : "<span>普通管理员</span>"%> </td> <td width="41%"><%# Eval("UserName")%></td> <td width="38%"><table width="70%" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td width="10%"><img src="../images/g2.jpg" width="14" height="16"></td> <td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">修改</a></span></td> <td width="10%"><img src="../images/g3.jpg" width="13" height="13"></td> <td width="40%"><span><a href="user_updateform.aspx?id=<%# Eval("Id") %>">删除</a></span></td> </tr> </table></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="6" bgcolor="#D5E0F2" class="p12d2"><img src="../images/x1x1.jpg" width="26" height="1"></td> </tr> </table></td> </tr> </table> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> </div> <div class="spClear"></div> <div style="line-height:30px;height:30px;"> <div class="right flickr"> <webdiyer:aspnetpager ID="AspNetPager1" runat="server" CssClass="formfield" CustomInfoClass="formbutton" CustomInfoHTML="第<font color='red'><b>%CurrentPageIndex%</b></font>页 共%PageCount% 页 %StartRecordIndex%-%EndRecordIndex%" CustomInfoTextAlign="Center" FirstPageText="首页" horizontalalign="Center" InputBoxStyle="width:19px" LastPageText="尾页" meta:resourceKey="AspNetPager1" NextPageText="下一页" PageSize="9" PrevPageText="前一页" showcustominfosection="Left" ShowInputBox="Always" ShowNavigationToolTip="True" style="FONT-SIZE: 12px" SubmitButtonClass="formfield" SubmitButtonText="GO" width="506px" onpagechanging="AspNetPager1_PageChanging" PageIndexBoxType="TextBox" ShowPageIndexBox="Never" AlwaysShow="True"> </webdiyer:aspnetpager> </div> <div class="left"> <span class="btn_all" onclick="checkAll(this);">全选</span> <span class="btn_bg"> <asp:LinkButton ID="lbtnDel" runat="server" onclick="lbtnDel_Click" OnClientClick="return confirm( '确定要删除这些记录吗? ');">批量删除</asp:LinkButton> </span> </div> </div> </div> <div> <ext:ScriptManager ID="ScriptManager1" runat="server"> </ext:ScriptManager> </div> </form>