当使用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中的代码应该怎样绑定啊?
this.GridView1.DataSource = StudentDAL.GetStudentDataSet();
this.GridView1.DataBind();
对gridview进行绑定;
当使用repeater是可以用
this.Repeater.DataSource = StudentDAL.GetStudentDataSet();
this.Repeater.DataBind();
对Repeater进行绑定。
但是当我什么都不用试应该对啥进行绑定啊?
代码如下:
<span><%#Eval("content") %>
</span>
cs中的代码应该怎样绑定啊?
直接用一个Label控件,然后从数据库读出数据赋给Label的Text属性
</span>
后台cs文件中public string content;然后在页面加载的时候给这个变量赋值
显示变量值就可直接使用
Literal.Text=""显示
显示变量值就可直接使用
Literal.Text=""显示具体代码怎么写啊?