performance issue about log into share point web part

problem posts: when you write down your credencials on login page and click OK button, you will enter into share point web part page. However it takes long time to load the data of the web part, and one cannot bear it. So what will we do about this?

reason: because gridview of web part will get a lot of data from component services as showing in the front page when you log into the default page and probably call component services many times.

solution: modify GetItemsCount method as ItemsCount property

     1   public static int GetItemsCount(DocumentumContext context, string objectId)
     2   {
     3      if (context == null)
     4       {
     5          throw new DocumentumException(DocumentumResourceDictionary.IS_NULL, "context");
     6       }

     7       try
     8        {
     9           return context.GetService<IDfsFolder>().GetFolderItemsCount(objectId);
     10       }
     11      catch (Exception ex)
     12      {
     13          throw ex;
     14         }
     15  }

       

 1       public int ItemsCount
 2       {
 3           get
 4           {
 5               DocumentumProperty pro = this.PropertyBag["r_link_cnt"];
 6               return pro == null ? 0 : Convert.ToInt32(pro.Value);
 7           }
 8           set
 9           {
 10               this.PropertyBag["r_link_cnt"].Value = value.ToString();
 11          }
 12      }

 

你可能感兴趣的:(performance)