protected void Load_documents()
    {
        DataTable dtCollection = new DataTable();

        dtCollection.Rows.Clear();
        dtCollection.Columns.Clear();
        dtCollection.Columns.Add("url");
        dtCollection.Columns.Add("Path");
        dtCollection.Columns.Add("File");

        string path = Server.MapPath("~/Assets/Attachments/" + Session["Appid"].ToString());

        if (checkfolder(path))
        {
            string docpath = path + "/Documents/";
            //document
            if (Directory.Exists(docpath))
            {
                DirectoryInfo docpathinfo = new DirectoryInfo(docpath);
                FileInfo[]    docList     = docpathinfo.GetFiles();
                docPersistRowIndex(docList, Session["Appid"].ToString(), dtCollection);
            }
        }
        Doc_grid.DataBind();
    }
    protected void load_grid()
    {
        if (Request.QueryString["did"] != null)
        {
            DataTable dtCollection = new DataTable();
            dtCollection.Rows.Clear();
            dtCollection.Columns.Clear();
            dtCollection.Columns.Add("Vfile");
            dtCollection.Columns.Add("Path");
            dtCollection.Columns.Add("File");

            string filename = Request.QueryString["did"].ToString() + ".pdf";
            string path     = "~/Assets/Documents/" + filename;
            if (File.Exists(Server.MapPath(path)))
            {
                Label  lblfilename     = (Label)DetailsView_Documents.FindControl("lblfilename");
                string virtualfilename = lblfilename.Text;
                PersistRowIndex(filename, virtualfilename, Request.QueryString["did"].ToString(), dtCollection);
            }


            Doc_grid.DataBind();
        }
    }