当使用gridview时可以用
 this.GridView1.DataSource = StudentDAL.GetStudentDataSet();
 this.GridView1.DataBind();
对gridview进行绑定;
当使用repeater是可以用
 this.Repeater.DataSource = StudentDAL.GetStudentDataSet();
 this.Repeater.DataBind();
对Repeater进行绑定。
但是当我什么都不用试应该对啥进行绑定啊?
代码如下:
<span><%#Eval("content") %>
</span>
cs中的代码应该怎样绑定啊?

解决方案 »

  1.   

    这里根本不需要数据绑定了
    直接用一个Label控件,然后从数据库读出数据赋给Label的Text属性
      

  2.   

    不需要绑定的份额时候,前台这样<span><%= content %>
    </span>
    后台cs文件中public string content;然后在页面加载的时候给这个变量赋值
      

  3.   

    datasource使用IEnumerable 或 IListSource 对象
    显示变量值就可直接使用
    Literal.Text=""显示
      

  4.   

    datasource使用IEnumerable 或 IListSource 对象
    显示变量值就可直接使用
    Literal.Text=""显示具体代码怎么写啊?