locked
Retrive image from server folder and show in image slider RRS feed

  • Question

  • User29410129 posted

    i want to show images in image slider. and images are stored in server folder. folder contain multiple images.  waiting for your feedback

    Thursday, December 31, 2015 9:16 PM

Answers

  • User61956409 posted

    Hi DanyalHaider,

    i want to show images in image slider. and images are stored in server folder. folder contain multiple images.

    Firstly, you could try to use the ASP.Net AJAX Control Toolkit SlideShow Extender control to build image Slide Show by fetching images from folder or directory.

    http://www.aspsnippets.com/Articles/ASPNet-AJAX-SlideShow-Extender-control-Tutorial-with-Example.aspx

    Secondly, you could refer to the following code to get the images from your server folder.

    string[] filePaths = Directory.GetFiles(Server.MapPath("~/Images/"));

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 1, 2016 2:25 AM

All replies

  • User61956409 posted

    Hi DanyalHaider,

    i want to show images in image slider. and images are stored in server folder. folder contain multiple images.

    Firstly, you could try to use the ASP.Net AJAX Control Toolkit SlideShow Extender control to build image Slide Show by fetching images from folder or directory.

    http://www.aspsnippets.com/Articles/ASPNet-AJAX-SlideShow-Extender-control-Tutorial-with-Example.aspx

    Secondly, you could refer to the following code to get the images from your server folder.

    string[] filePaths = Directory.GetFiles(Server.MapPath("~/Images/"));

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 1, 2016 2:25 AM
  • User29410129 posted

    Boss i am trying in this way

            public string ResoulveImage_Url()
            {
                string ResourceImagePath = "#";
                string parentResourceFolder = System.IO.Path.Combine(Server.MapPath(TopRootName + _File_Format));
                string productImageFolder = System.IO.Path.Combine(parentResourceFolder + Path.DirectorySeparatorChar + RootName + Path.DirectorySeparatorChar + HashKey + Path.DirectorySeparatorChar);
                if (Directory.Exists(productImageFolder))
                {
                    var images = Directory.GetFiles(productImageFolder);
    
    
                    if (images != null)
                    {
                        //productImagePath = ResolveUrl(images[0]);
                        FileInfo fi = new FileInfo(images[0]);
                        ResourceImagePath = string.Concat("uploads", "/", _File_Format, "/", "Thumbnails/", HashKey, "/", fi.Name);
    
                    }
                }
    
                return ResourceImagePath;
            }
                            <asp:Image ID="img_slider" runat="server"  ImageUrl='<%# ResoulveImage_Url()  %>' Height="250" Width="380" alt="" />

    Suppose i have folder name Images. that constain multiple images now i want to show that all images. current image slide after specific time span and next image display

    Saturday, January 2, 2016 5:29 PM
  • User61956409 posted

    Hi DanyalHaider,

    Suppose i have folder name Images. that constain multiple images now i want to show that all images. current image slide after specific time span and next image display

    ASP.Net AJAX Control Toolkit SlideShow Extender control could meet your requirements, please try to use it. The tutorial (I shared you) explained how to use it.

    Fei Han - MSFT

    http://www.aspsnippets.com/Articles/ASPNet-AJAX-SlideShow-Extender-control-Tutorial-with-Example.aspx

    Best Regards,

    Fei Han

    Monday, January 4, 2016 7:53 AM
  • User29410129 posted

    Path i am giving is not static when i remove static keyword my method is not executing. using same logic that you suggested me above

    Wednesday, January 6, 2016 11:22 AM
  • User29410129 posted

    Path i am giving is not static when i remove static keyword my method is not executing. using same logic that you suggest me above link

    ASP.Net AJAX Control Toolkit SlideShow Extender control could meet your requirements, please try to use it. The tutorial (I shared you) explained how to use it.

    Thursday, January 7, 2016 6:22 AM
  • User61956409 posted

    Hi DanyalHaider,

    Firstly, SlideShow Service Method should be static.

    Besides, if you’d like to using some variables, you could pass variables to SlideShow service method via ContextKey.

    Best Regards,

    Fei Han

    Tuesday, January 12, 2016 3:17 AM
  • User29410129 posted

    How i can use ContextKey in my context? Actually parameter i am passing declare as global variable  in back-end code. And assigning value to these all global variable from DataTable. how i resolve this issue?

    Saturday, January 16, 2016 7:28 AM