c# - Ajax slide show extender does not work -


i followed tutorial link ajax slide show extender

my code follows

<div>     <table style="border:solid 3px #d55500; width:400px; height:400px" cellpadding="0"              cellspacing="0">         <tr style="background-color:#d55500">             <td style=" height:10%; color:white; font-weight:bold; font-size:larger"                   align="center">                 <asp:label id="lbltitle" runat="server"></asp:label>             </td>         </tr>         <tr>             <td>                 <asp:image id="imgslides" runat="server" height="400px" width="400px" />             </td>         </tr>         <tr>             <td align="center">                 <asp:label id="lblimgdesc" runat="server"></asp:label>             </td>         </tr>         <tr>             <td align="center">                 <asp:button id="btnprevious" runat="server" text="prev" cssclass="button" />                 <asp:button id="btnplay" runat="server" text="play" cssclass="button" />                 <asp:button id="btnnext" runat="server" text="next" cssclass="button" />             </td>         </tr>     </table>   <ajax:slideshowextender runat="server" autoplay="true" imagetitlelabelid="lbltitle"      imagedescriptionlabelid="lblimgdesc" loop="true"    nextbuttonid="btnnext" previousbuttonid="btnprevious" playbuttonid="btnplay"       playbuttontext="play" stopbuttontext="stop"    targetcontrolid="imgslides" slideshowservicepath="slideshow.asmx"       slideshowservicemethod="getslides"></ajax:slideshowextender> 

and in web service have file

[webmethod]          public ajaxcontroltoolkit.slide[] getslides()     {         string[] imagenames = system.io.directory.getfiles(server.mappath(@"c:\users\mayer\documents\visual studio 2010\projects\project1\project1\images\"));         ajaxcontroltoolkit.slide[] photos = new ajaxcontroltoolkit.slide[imagenames.length];         (int = 0; < imagenames.length; i++)         {             string[] file = imagenames[i].split('\\');             photos[i] = new ajaxcontroltoolkit.slide("images/" + file[file.length - 1], file[file.length - 1], "");         }         return photos;     } 

i have images folder cant see slide show

please help

you should pass relative address server.mappath

it should like: ~\project1\project1\images\ instead of physical path:
c:\users\mayer\documents\visual studio 2010\projects\project1\project1\images\

the mappath method maps specified relative or virtual path corresponding physical directory on server.

from docs: http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -