首页 新闻 会员 周边

repeater为何绑定不出数据!!!我在自己的本子上能显示出来,但是在公司的机子上就不行了,数据表中我删了一个字段,但是在相应的Modeol和DAL我都将其注释了!结果还是绑定不上

0
悬赏园豆:10 [已解决问题] 解决于 2011-04-02 01:42

aspx代码

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jq_List.aspx.cs" Inherits="webApp.L_Admin.jq_List1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>类别管理</title>
    <link rel="stylesheet" type="text/css" href="../images/style.css" />
    <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
    <link href="../../Css/pagination.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../js/jquery.pagination.js"></script>
    <script type="text/javascript" src="../js/function.js"></script>
    <script type="text/javascript">
     $(function() {
            //分页参数设置
            $("#Pagination").pagination(<%=pcount %>, {
            callback: pageselectCallback,
            prev_text: "« 上一页",
            next_text: "下一页 »",
            items_per_page:<%=pagesize %>,
      num_display_entries:3,
      current_page:<%=page %>,
      num_edge_entries:2,
      link_to:"?page=__id__"
           });
        });
        function pageselectCallback(page_id, jq) {
           //alert(page_id); 回调函数,进一步使用请参阅说明文档
        }
        $(function () {
            $(".msgtable tr:nth-child(odd)").addClass("tr_bg"); //隔行变色
            $(".msgtable tr").hover(
       function () {
           $(this).addClass("tr_hover_col");
       },
       function () {
           $(this).removeClass("tr_hover_col");
       }
      );
        });
    </script>
</head>
<body style="padding:10px;">
    <form id="form1" runat="server">
        <div class="navigation"><span class="add"></span><b>您当前的位置:首页 &gt; 景区管理 &gt; 景区列表</b></div>
        <div style="padding-bottom:10px;"></div>

        <asp:Repeater ID="rptClassList" runat="server" OnItemCommand="rptClassList_ItemCommand">
            <HeaderTemplate>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
                    <tr>
                        <th width="20%">编号</th>
                        <th width="15%" align="left">景区名称</th>
                        <th width="13%" align="left">所属城市</th>
                        <th width="8%" align="right">管理操作</th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
            <td align="center">
            <asp:HiddenField ID="txtJQId" runat="server" Value='<%#Eval("Id") %>' />
            <%#Eval("Id")%></td>
            <td align="left">
            <a href="jq_ps_List.aspx?id=<%#Eval("Id") %>"><%#Eval("JR_Name")%></td></a>
            <td align="left">
            <%#RptDisplay(int.Parse(Eval("JR_Three_ID").ToString()))%></td>
            </td><td align="center">&nbsp;<span></span>
            </td>
            <td align="left"><span><a href="jq_Edit.aspx?id=<%#Eval("Id") %>">修改</a></span>
            &nbsp;<span><asp:LinkButton ID="lbDel" CommandName="btndel" runat="server" OnClientClick="return confirm( '该操作会删除本类别和下属类别,确定要删除吗? ');">删除</asp:LinkButton></span></td>
            </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <div id="Pagination" class="right flickr"></div>
     </form>
</body>
</html>

cs代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Miyouba.DAL;
using Miyouba.BLL;
using Miyouba.Common;
using Miyouba.Model;

namespace webApp.L_Admin
{
    public partial class jq_List1 : ManagePage
    {
        public int pcount;  //总条数
        public int page;    //当前页数
        public int pagesize = 10;  // 设置每页显示的行数
        public int TypeId;        // 类别种类
        public int classId = 0;
        public QY_three threeModel = new QY_three();
        public JQ_Region regionModel = new JQ_Region();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RptBindRegion();
                RptDisplay(regionModel.JR_Three_ID);
            }
        }
        protected void RptBindRegion()
        {
            this.rptClassList.DataSource = BLL_JQ_Region.GetList(regionModel);
            this.rptClassList.DataBind();
        }
        protected string RptDisplay(int id)
        {
            return BLL_QY_three.GetInfo(threeModel, id).QY_three_Name;
        }

        protected void rptClassList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            HiddenField txtClassId = (HiddenField)e.Item.FindControl("txtJQId");
            switch (e.CommandName.ToLower())
            {
                case "btndel": BLL_JQ_Region.Delete(Convert.ToInt32(txtClassId.Value));
                    JscriptPrint("删除成功啦!", "", "Success");
                    RptBindRegion();
                    break;
            }
        }
    }
}

图片在这:

fytz_2011的主页 fytz_2011 | 初学一级 | 园豆:155
提问于:2011-03-23 17:06
< >
分享
最佳答案
0

你先逐步调试一下,看看sql语句能否得到数据。

收获园豆:10
坤坤 | 小虾三级 |园豆:919 | 2011-03-23 18:03
自己已解决,谢谢了!!!!
fytz_2011 | 园豆:155 (初学一级) | 2011-04-02 01:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册