Re: Creating multiple galleries programtically

  •  02-26-2011, 1:10 AM

    Re: Creating multiple galleries programtically

    Hi pat8719,
    Please try the code below,
     
    Aspx
     <%if(GalleryBrowser1.AllowEdit){%>
                            <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Upload Photos</a> |
                        <%}%>
                            <a href="#" onclick="thegallerybrowser.ShowSlider();return false;">View as slide show</a>
                        </div>
                        <dotnetgallery:gallerybrowser runat="server" id="GalleryBrowser1" Width="780" Height="400" />
    C#
    1. protected override void OnInit(EventArgs e)   
    2. {   
    3.     base.OnInit(e);   
    4.        
    5.     GalleryBrowser1.Layout="SlideShow";   
    6.     string folder = "~/GalleryFiles/" + _profileUser.UserName + sport.sportName.Trim() + "/";   
    7.     if (!System.IO.Directory.Exists(Server.MapPath(folder)))   
    8.         System.IO.Directory.CreateDirectory(Server.MapPath(folder));   
    9.     GalleryBrowser1.GalleryFolder = folder;   
    10.     GalleryBrowser1.LogonUserName = HttpContext.Current.Profile.UserName;   
    11.     GalleryBrowser1.Viewer = "LightBox";   
    12.     GalleryBrowser1.ConsoleLayout = "Explorer";   
    13.     GalleryBrowser1.Theme = "Classic";   
    14.     GalleryBrowser1.Layout = "Classic";   
    15.        
    16.        
    17.   
    18.        
    19. //  if(Context.User.Identity.Name=="Admin")   
    20. //  {   
    21.           
    22.         GalleryBrowser1.AllowEdit=true;   
    23.         GalleryBrowser1.AllowPostComment=true;   
    24.         GalleryBrowser1.AllowShowComment=true;   
    25. //  }   
    26.        
    27. }  
     

    Regards,
    Jeff
View Complete Thread