解决方案 »

  1.   

    jquery.GalleryView百度一下这个插件的用法就好了啊..很简单你那个无非是用split分割一下,再for循环一下就把所有图片都展示出来了
      

  2.   

    字段里是这样的       ../LadlxtUploadFile/201408131414031 (4).jpg*../LadlxtUploadFile/201408131414031 (5).jpg*../LadlxtUpl想去掉*号后实现图片查看
      

  3.   

    var imgUrl=xxxxxxx  ///所有图片字段的内容var temp = imgUrl.Split("*");
    var str=str.empty;
    for(int i=0;i<=temp.Count();i++)
    {
        str+="<div><img src='"+temp[i]+"' /></div>";
    }
    return str;
      

  4.   

    还是不会
    return str;   返回的str 要怎么弄呢
      

  5.   

    看懂这个意思了 但是不知道这个返回的str 怎么使用
      

  6.   

    编辑绑定数据库照片分页显示
     // 显示分类及一张照片
          public DataSet ShowCategory()
        {
            SqlConnection conn = new SqlConnection(connstr);
            string sqlstr = "select A.*,"
                        + "(select count(*) from Photo B where B.CategoryID = A.ID) AS p_num,"
                        + "(select top 1 C.url from Photo C where C.CategoryID = A.ID) AS url "
                        + "from Photo_Category AS A "
                        + "where A.C_Status = '公开' "
                        + "and  A.ID in "
                        + "(select CategoryID from Photo)";
            SqlDataAdapter da = new SqlDataAdapter(sqlstr,conn);
            DataSet ds = new DataSet();
            try
            {
                conn.Open();
                da.Fill(ds,"P_Category");
            }
            catch(Exception ex)
            {
                throw new Exception(ex.Message,ex);
            }
            finally
            {
                conn.Close();
            }
            return ds;
        }
      // 显示分类内的相册
          public DataSet ShowPhoto(int Category)
        {
            SqlConnection conn = new SqlConnection(connstr);
            string sqlstr = "select * from Photo where CategoryID = @CategoryID";
            SqlDataAdapter da = new SqlDataAdapter(sqlstr,conn);
            da.SelectCommand.Parameters.Add("@CategoryID",SqlDbType.Int,4).Value = Category;
            DataSet ds = new DataSet();
            try
            {
                conn.Open();
                da.Fill(ds,"Photo");
            }
            catch(Exception ex)
            {
                throw new Exception(ex.Message,ex);
            }
            finally
            {
                conn.Close();
            }
            return ds;
        }
      // 编辑图片信息
        public int EditPhoto(int id, string title, string description)
        {
            SqlConnection conn = new SqlConnection(connstr);
            string sqlstr = "update Photo set Title=@title,Descript=@description where ID=@id";
            SqlCommand cmd = new SqlCommand(sqlstr,conn);
            cmd.Parameters.Add("@id",SqlDbType.Int,4).Value = id;
            cmd.Parameters.Add("@title",SqlDbType.VarChar,50).Value = title;
            cmd.Parameters.Add("@description",SqlDbType.VarChar,100).Value = description;
            int result = -1;
            try
            {
                conn.Open();
                result = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            finally
            {
                conn.Close();
            }
            return result;
        }
    //分页功能
    <asp:DataPager ID="AfterListDataPager" runat="server" PagedControlID="lvPhoto">
            <Fields>//CodeGo.net/
                <asp:NextPreviousPagerField ButtonType="Image" FirstPageImageUrl="~/images/an_06.gif" 
                    ShowFirstPageButton="true" ShowNextPageButton="False" LastPageImageUrl="~/images/an_12.gif" 
                    NextPageImageUrl="~/images/an_10.gif" 
                    PreviousPageImageUrl="~/images/an_08.gif" />
                <asp:NumericPagerField ButtonCount="10" />
                <asp:NextPreviousPagerField ButtonType="Image" LastPageImageUrl="~/images/an_12.gif" 
                    ShowLastPageButton="true" 
                    ShowPreviousPageButton="False" FirstPageImageUrl="~/images/an_06.gif" 
                    NextPageImageUrl="~/images/an_10.gif" 
                    PreviousPageImageUrl="~/images/an_08.gif" />
            </Fields>
        </asp:DataPager>