在制作ASP.NET网站中,怎样在DataList详细页面中对内容分页

来源:百度知道 编辑:UC知道 时间:2024/05/22 09:47:26
如题。还有个问题:网站首页一般会有个图片框,里面的图片一般有4张,会自动跟新变新图片。这个是怎么实现的?
请高手帮帮忙。谢谢了

看个例子吧
public class ReadImage : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

string mark=Request.QueryString["id"].Trim();
SqlConnection coon=new SqlConnection("data source=Localhost;user
id=sa;pwd=;initial catalog=testpic");
string sql="select imgdata,imgtype from pic where id="+mark;
SqlCommand cmd=new SqlCommand(sql,coon);
try
{
coon.Open();
SqlDataReader da=cmd.ExecuteReader();
if(da.Read())
{
//Response.Clear();
Response.ContentType=da["imgtype"].ToString();