Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Problematiche su pagina master

    Scusate solo una domanda:
    ho utilizzato il codice per far funzionare una slideshow in un progetto di prova su una pagina default.aspx
    poi lo stesso codice l'ho messo su un nuovo progetto e su una pagina master e ovviamente collegata a una pagina default.aspx che mando in esecuzione; il fatto è che non funziona; ma sulla master si può utilizzare questo codice ?
    In pratica sulla pagina Master.cs nel codice ho:
    codice:
     
        [WebMethod]
        [ScriptMethod]
        public static Slide[] GetImages()
        {
            List<Slide> slides = new List<Slide>();
            string path = HttpContext.Current.Server.MapPath("~/immagini/slideshow/");
            if (path.EndsWith("\\"))
            {
                path = path.Remove(path.Length - 1);
            }
            Uri pathUri = new Uri(path, UriKind.Absolute);
            string[] files = Directory.GetFiles(path);
            foreach (string file in files)
            {
                Uri filePathUri = new Uri(file, UriKind.Absolute);
                slides.Add(new Slide
                {
                    Name = Path.GetFileNameWithoutExtension(file),
                    Description = Path.GetFileNameWithoutExtension(file) + " Description.",
                    ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString()
                });
            }
            return slides.ToArray();
    
    
        }
    in debuger non me lo esegue ????


    e nel origine master page ho :


    codice:
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        
         <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </cc1:ToolkitScriptManager>
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <asp:Button ID="btnPrevious" runat="server" Text="<<" Font-Size="20" />
            </td>
            <td>
                <asp:Image ID="Image1" runat="server" Height="300px" Width="1187px" />
                <cc1:SlideShowExtender ID="SlideShowExtender" runat="server" TargetControlID="Image1"
                    SlideShowServiceMethod="GetImages" ImageTitleLabelID="lblImageTitle" ImageDescriptionLabelID="lblImageDescription"
                    AutoPlay="true" PlayInterval="2000" Loop="true" PlayButtonID="btnPlay" StopButtonText="Stop"
                    PlayButtonText="Play" NextButtonID="btnNext" PreviousButtonID="btnPrevious">
                </cc1:SlideShowExtender>
            </td>
            <td>
                <asp:Button ID="btnNext" runat="server" Text=">>" Font-Size="20" />
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <asp:Button ID="btnPlay" runat="server" Text="Play" Font-Size="20" />
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <br />
                <b>Name:</b>
                <asp:Label ID="lblImageTitle" runat="server" Text="Label" /><br />
                <b>Description:</b>
                <asp:Label ID="lblImageDescription" runat="server" Text="Label" />
            </td>
        </tr>
    </table>
    
    
    
    
    
    
    
    
        <div>
         
            <br />
            <br />
            <br />
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>

    potete aiutarmi ?


    Grazie
    Ultima modifica di Marcolino21; 16-10-2014 a 16:01

  2. #2
    Quote Originariamente inviata da Marcolino21 Visualizza il messaggio
    Scusate solo una domanda:
    ho utilizzato il codice per far funzionare una slideshow in un progetto di prova su una pagina default.aspx
    poi lo stesso codice l'ho messo su un nuovo progetto e su una pagina master e ovviamente collegata a una pagina default.aspx che mando in esecuzione; il fatto è che non funziona; ma sulla master si può utilizzare questo codice ?
    In pratica sulla pagina Master.cs nel codice ho:
    codice:
     
        [WebMethod]
        [ScriptMethod]
        public static Slide[] GetImages()
        {
            List<Slide> slides = new List<Slide>();
            string path = HttpContext.Current.Server.MapPath("~/immagini/slideshow/");
            if (path.EndsWith("\\"))
            {
                path = path.Remove(path.Length - 1);
            }
            Uri pathUri = new Uri(path, UriKind.Absolute);
            string[] files = Directory.GetFiles(path);
            foreach (string file in files)
            {
                Uri filePathUri = new Uri(file, UriKind.Absolute);
                slides.Add(new Slide
                {
                    Name = Path.GetFileNameWithoutExtension(file),
                    Description = Path.GetFileNameWithoutExtension(file) + " Description.",
                    ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString()
                });
            }
            return slides.ToArray();
    
    
        }
    in debuger non me lo esegue ????


    e nel origine master page ho :


    codice:
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        
         <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </cc1:ToolkitScriptManager>
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <asp:Button ID="btnPrevious" runat="server" Text="<<" Font-Size="20" />
            </td>
            <td>
                <asp:Image ID="Image1" runat="server" Height="300px" Width="1187px" />
                <cc1:SlideShowExtender ID="SlideShowExtender" runat="server" TargetControlID="Image1"
                    SlideShowServiceMethod="GetImages" ImageTitleLabelID="lblImageTitle" ImageDescriptionLabelID="lblImageDescription"
                    AutoPlay="true" PlayInterval="2000" Loop="true" PlayButtonID="btnPlay" StopButtonText="Stop"
                    PlayButtonText="Play" NextButtonID="btnNext" PreviousButtonID="btnPrevious">
                </cc1:SlideShowExtender>
            </td>
            <td>
                <asp:Button ID="btnNext" runat="server" Text=">>" Font-Size="20" />
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <asp:Button ID="btnPlay" runat="server" Text="Play" Font-Size="20" />
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <br />
                <b>Name:</b>
                <asp:Label ID="lblImageTitle" runat="server" Text="Label" /><br />
                <b>Description:</b>
                <asp:Label ID="lblImageDescription" runat="server" Text="Label" />
            </td>
        </tr>
    </table>
    
    
    
    
    
    
    
    
        <div>
         
            <br />
            <br />
            <br />
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>

    potete aiutarmi ?


    Grazie
    Nessuno mi sa aiutare ... ? Mica posso inserire il codice per slideshow in tutte le pagine figlie ? Ci sarà un modo !!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.