解决方案 »

  1.   

    新建一个文件,在vs, web开发中选择用户控件,里面的显示内容你可以根据需要,进行显示,有那个页面要就这个用户控件躲进去就可以了
      

  2.   

    Refer here:
    http://www.cnblogs.com/insus/archive/2012/12/31/2841212.htmlsee also:
    http://www.cnblogs.com/insus/p/3193619.html
      

  3.   

    绑定ListView中显示多张图片
    //ListView控件设置显示几条数据(这里设置显示5张图片数量)
    <asp:ListView ID="lvPhoto" runat="server" GroupItemCount="5"
      //绑定数据到ListView
        private void BindListView()
        {
            Album am = new Album();
            if (Session["categoryID"] != null)
            {
                DataSet ds = am.ShowPhoto(Int32.Parse(Session["categoryID"].ToString()));
                if (ds.Tables[0].Rows.Count == 0)
                {
                    Response.Redirect("Default.aspx");
                }
                lvPhoto.DataSource = ds;
                lvPhoto.DataBind();
            }
            else
            {
                return;
            }
    }
    //单击小图片显示大图片
        protected void lkbImg_Command(object sender, CommandEventArgs e)
        {
            imgBig.Style.Add("visibility", "visibe");
            imgBig.Src = "UpSmall/" + e.CommandArgument.ToString();
            sDescription.InnerHtml = e.CommandName.ToString();
        }//更新和删除数据(略)
      

  4.   

    你新建一个用户控件 比方叫做 imgShow.ascx    在cs里设置属性  imgUrlStrs  (这里面放的是图片的url的字符窜例如: imgUrlStrs="1.jpg,2.jpg,3.jpg")处理这个属性放到String[] 数组里面,然后在 imgShow.ascx 前天页面遍历显示就行了你调用用户控件的页面的    后台cs代码里 给这个 imgShow1 用户控件的 属性 imgUrlStrs 赋值(这个值可能是你从数据库取的值)