本文介绍了缺少数据列表分页的程序集引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨 无法解决错误.出现以下错误 找不到类型或名称空间名称"DataListPaging"(是否缺少using指令或程序集引用?) 这是代码
Hi Unable to sort out the mistake. getting the following error The type or namespace name ''DataListPaging'' could not be found (are you missing a using directive or an assembly reference?) here is the code
using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Data.SqlClient;受保护的void Page_Load(对象发送者,EventArgs e)
protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack) { BindDataList(); DataListPaging cpage = new DataListPaging(); try { cpage.CurrentPageIndex = 0; cpage.PageSize = 5; cpage.DataSource = dt; Session["DT"] = dt; Session["CPAGE"] = cpage; BindList(cpage, dt); } catch (Exception) { } finally { cpage = null; } }void BindList(DataListPaging cpage, DataTable dt) { try { dlistProfileSearch.DataSource = cpage.DoPaging; dlistProfileSearch.DataBind(); lnkPrev.Enabled = !cpage.IsFirstPage; !cpage.IsLastPage; lblPageStatus.Text = NavigationIndicator(); } catch (Exception) { } finally { cpage = null; } }
请帮助
Please help
推荐答案Wes指出您要引用的DataListPaging对象必须是第三方或自定义对象,因此您需要引用它所在的程序集.但是,我不认为这是您要尝试做的事情. 阅读此 [ ^ ]并对DataList分页进行一些研究,尤其是我认为您可能想要的PagedDataSource. As Wes has pointed out the DataListPaging object you are referring to must be a third party or custom object and you''ll need to reference the assembly in which it resides. However, I don''t think that''s what you are attempting to do. Read this[^] and do some research on DataList paging and, especially, a PagedDataSource which is what I think you probably want.
更多推荐
缺少数据列表分页的程序集引用
发布评论