Re: How I can get the category name which I newly created in the Gallery browser

  •  12-20-2013, 8:19 AM

    Re: How I can get the category name which I newly created in the Gallery browser

    Hi narendrababu,

     

    You can use the code below to get the category name.  title is the category name, "~/GalleryFiles/" is your gallery folder location.

     

    1. void Page_Load(object sender, EventArgs e)  
    2. {  
    3.     using (DotNetGallery.GalleryDataProvider provider = DotNetGallery.GalleryDataProvider.CreateInstance(Context, "~/GalleryFiles/"))  
    4.     {  
    5.         //get all category  
    6.         string[] categoryArray = provider.GetCategoryArray();  
    7.         for (int i = 0; i < categoryArray.Length; i++)  
    8.         {  
    9.             string title;  
    10.             string description;  
    11.             string properties;  
    12.               
    13.             if (provider.GetCategoryInfo(categoryArray[i].ToString(), out title, out description, out properties))  
    14.             {  
    15.                 //title is the category name  
    16.                 //show all title in label1  
    17.                 label1.Text += title;  
    18.             }  
    19.         }  
    20.     }  
    21. }  
     

    Regards,

     

    Ken 

View Complete Thread