我引用了公共类的一个方法 如下!可 是提示 当前上下文中不存在名称“getContentLsit”
这是什么原因啊?
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;public partial class UserControl_News_List : System.Web.UI.UserControl
{
    ActionDesign Ad = new ActionDesign();
    protected void Page_Load(object sender, EventArgs e)
    {    }
    protected void Databind()
    {
        DataTable dt = getContentLsit(CID);
        //或者
        DataTable dt = getContentLsit(CID, strKey);
        Repeater1.DataSource = ds.DefaultView;
        Repeater1.DataBind();
    }
}

解决方案 »

  1.   

    getContentLsit
    这个方法是   ActionDesign这里面的一个方法! 
      

  2.   


    未找到 getContentLsit方法
    是不是缺少了引用集?在getContentLsit(CID)处按f12,看有什么提示
      

  3.   

    ......晕,你概念错了
    DataTable dt = Ad.getContentLsit(CID);
      

  4.   

      选择方法,能转过去定义么 
     ActionDesign里面的方法, 用 ad.getContentLsit
      

  5.   

    按照你说的提示说  当前上下文中不存在名称“CID”
      

  6.   

    CID 是你自己定义的对象,找找
      

  7.   

    既然getContentLsit 属于ActionDesign 中定义的方法
    那么在使用时需要先实例ActionDesign 如你的代码:ActionDesign Ad = new ActionDesign();
    在调用 getContentLsit 方法时应该是这样:DataTable dt = Ad.getContentLsit(CID);呵呵
      

  8.   

    再者没有看到你写的CID,是在何处定义的呢?
      

  9.   

    getContentLisit(CID)
    getContentLisit(CID,strKey)这是两个方法  通过传参数CID,strKey得到一个datatable数据集  这个方法有可能是自己定义的或系统自带的  如果有此方法 传参调用 就可得到数据
      

  10.   

    转getContentLsit定义
    DLL是否引用
      

  11.   

    你是用三层结构写的吧,首先要添加DLL的引用,再实例化对象,CID应该是你自己写的MODEL吧,用.NET的转到定义的地方看看。
      

  12.   

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data;public partial class UserControl_News_List : System.Web.UI.UserControl
    {
        ActionDesign Ad = new ActionDesign();
       
        protected void Page_Load(object sender, EventArgs e)
        {    }
        protected void Databind()
        {
            String CID;
            String strKey;
            
                  //或者
            DataTable dt = Ad.getContentLsit(CID,strKey);
            Repeater1.DataSource = ds.DefaultView;
            Repeater1.DataBind();
        }
    }已经解决了  谢谢 了