Eval()、XPath() 和 Bind() 这类数据绑定方法只能在数据绑定控件的上下文中使用。

源代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="Tc.Web.admin.yewu.list1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server" id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>业务列表</title>
    <link type="text/css" rel="stylesheet" href="../../css/base.css" />
    <script type="text/javascript" src="../../js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="../js/adminlistdels.js"></script>
</head>
<body style="background-image:url('../../images/admin/images/allbtbg.gif');margin-left:8px;margin-top:8px">
    <form id="form1" runat="server">
       <table style="width:98%;text-align:center;border:0;background-color:#D6D6D6">
           <tr>
               <td style="height:28px;background-image:url('../images/tbg.gif');padding-left:10px" colspan="8">
                   <div style="float:left">
                       <b>业务列表</b>
                   </div>
                   <div style="float:right;padding-right:6px">
                       [<a href="info.aspx?types=<%=types %>"><u>新增业务</u></a>]
                   </div>
               </td>
           </tr>
           <tr style="text-align:center;height:26px;background-color:#FBFCE2">
               <td style="width:6%">选择</td>
               <td style="width:40%">业务名称</td>
               <td style="width:20%">业务分类</td>
               <td style="width:18%">创建时间</td>
               <td style="width:15%">管理</td>
           </tr>
           <asp:Repeater ID="rp_list" runat="server">
                <ItemTemplate>
                    <tr style="text-align:center;height:26px;background-color:#FFFFFF;" onmousemove="javascript:this.background-color:#FCFDEE" onmouseout="javascript:this.background-color:#FFFFFF">
                        <td>
                            <input type="checkbox" name="adis" value="<%=Eval("id") %>" class="np"/>
                        </td>
                        <td><%=Eval("title") %></td>
                        <td><%#LibCache.get_fenlei_name(Eval("fenleiid").ToString().GetInt()) %></td>
                        <td><%#Eval("addtime","{0:yyyy-MM-dd}") %></td>
                        <td>
                            <a href='info.aspx?types=<%=types %>&id=<%#Eval("id") %>'>[更改]</a>
                            <asp:LinkButton ID="lbtnDel" runat="server" OnClientClick="return confirm('确认删除?')"
                                CommandArgument='<%#Eval("ID") %>' OnClick="lbtnDel_Click">[删除]</asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
           </asp:Repeater>
           <tr style="height:28px;background-color:#FFFFFF;text-align:left">
               <td colspan="8">
                    <a href='#' onclick='quanxuan()' class='np coolbg'>[全选]</a>
                    <a href='#' onclick='fanxuan()' class='np coolbg'>[取消]</a>
                    <asp:LinkButton ID="lbtnDelete" runat="server" OnClientClick="return confirm('确认删除?')"
                        OnClick="btnDelete_Click">[批量删除]</asp:LinkButton>
               </td>
           </tr>
           <tr style="text-align:center;height:28px;background-color:#F9FCEF">
               <td colspan="8">
                   <webdiyer:AspNetPager ID="aspnetpage" runat="server" FirstPageText="首页" LastPageText="尾页"
                        NextPageText="下一页" PrevPageText="上一页" OnPageChanged="aspnetpage_PageChanged"
                        HorizontalAlign="Center" PageIndexBoxType="DropDownList" ShowPageIndexBox="Always"
                        SubmitButtonText="Go" TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" PageSize="10" LayoutType="Div">
                    </webdiyer:AspNetPager>
               </td>
           </tr>
       </table>
    </form>
</body>
</html>

报错内容截图如下:

图片说明

在线等,求大神指导!!!

1个回答

<%=Eval("title") %> = 换成#
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!