235 messaggi dal 27 aprile 2009
Ciao a tutti, ho una una pagina che è fatta cosi;

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterLogged.master" AutoEventWireup="true" CodeBehind="page.aspx.cs" Inherits="page" %>
<%@ Register Src="~/xxx/page2.ascx" TagPrefix="control" TagName="Controllo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" 
runat="server">
    <link href="../css/GridView.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server" >
<asp:UpdatePanel ID="pnlUpdOrdini" runat="server">
 <ContentTemplate>
 <a href="../WebForm1.aspx" class='ajax' title=".: STAMPA DETTAGLIO MOVIMENTI :."> TEST 2  /a>
            <control:controllo ID="ricOrd" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>


All'interno di Page2 ho una form di ricerca subito dopo un link
<a href="../WebForm1.aspx" class='ajax' title=".: STAMPA DETTAGLIO MOVIMENTI :."> TEST 1 /a>

Se faccio partire l'applicazione e clicco sui due link tutto funziona :)
mi si apre la colarbox.

Ora..all'interno della pagina Page2 c'è un pulsante che all'evento Onclick mi carica dei dati dentro il gridview.

Dopo aver caricato il gridview, riprovo i due link.
Nessuno dei due funziona.


Facendo dei Test ho visto che quando carica la pagina entra nella funzione $(this).ready(function () { }
mentre al click per cui nel postback non entra più dentro a tale funzione per cui i link non vanno più.

il seguente codice
    <script type="text/javascript" language="javascript">
    
        $(this).ready(function () {
            debugger;
            //Examples of how to assign the ColorBox event to elements
            $(".group1").colorbox({ rel: 'group1' });
            $(".group2").colorbox({ rel: 'group2', transition: "fade" });
            $(".group3").colorbox({ rel: 'group3', transition: "none", width: "75%", height: "75%" });
            $(".group4").colorbox({ rel: 'group4', slideshow: true });
            $(".ajax").colorbox({ iframe: true, innerWidth: 700, innerHeight: 500 });
            $(".youtube").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
            $(".iframe").colorbox({ iframe: true, width: "80%", height: "80%" });
            $(".inline").colorbox({ inline: true, width: "50%" });
            $(".callbacks").colorbox({
                onOpen: function () { alert('onOpen: colorbox is about to open'); },
                onLoad: function () { alert('onLoad: colorbox has started to load the targeted content'); },
                onComplete: function () { alert('onComplete: colorbox has displayed the loaded content'); },
                onCleanup: function () { alert('onCleanup: colorbox has begun the close process'); },
                onClosed: function () { alert('onClosed: colorbox has completely closed'); }
            });

            //Example of preserving a JavaScript event for inline calls.
            $("#click").click(function () {
                $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
                return false;
            });
        });
    </script>


è Nella master page cosi che possa essere utilizzato ovunque.

Come posso risolvere il problema? grazie a tutti
235 messaggi dal 27 aprile 2009
altra cosa che ho capito il problema è dovuto al fatto che la seconda pagina è dentro ad un updatepanel XD XD.
Ora devo capire come risolvere :)
235 messaggi dal 27 aprile 2009
Risolto modificato la master
<script type="text/javascript" language="javascript">

        $(this).ready(function () {
            colorbox();

        });

        function colorbox() {

            //Examples of how to assign the ColorBox event to elements
            $(".group1").colorbox({ rel: 'group1' });
            $(".group2").colorbox({ rel: 'group2', transition: "fade" });
            $(".group3").colorbox({ rel: 'group3', transition: "none", width: "75%", height: "75%" });
            $(".group4").colorbox({ rel: 'group4', slideshow: true });
            $(".ajax").colorbox({ iframe: true, innerWidth: 700, innerHeight: 500 });
            $(".youtube").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
            $(".iframe").colorbox({ iframe: true, width: "80%", height: "80%" });
            $(".inline").colorbox({ inline: true, width: "50%" });
            $(".callbacks").colorbox({
                onOpen: function () { alert('onOpen: colorbox is about to open'); },
                onLoad: function () { alert('onLoad: colorbox has started to load the targeted content'); },
                onComplete: function () { alert('onComplete: colorbox has displayed the loaded content'); },
                onCleanup: function () { alert('onCleanup: colorbox has begun the close process'); },
                onClosed: function () { alert('onClosed: colorbox has completely closed'); }
            });

            //Example of preserving a JavaScript event for inline calls.
            $("#click").click(function () {
                $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
                return false;
            });
        }
    </script>



e dentro al updatepanel
<script type="text/javascript">

                    Sys.Application.add_load(colorbox); //Triggers after a sync or an asyinc post-back.
        
                
                </script>

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.
Community
Ultimi messaggi
UTENTI ONLINE
In primo piano

I più letti di oggi

Media
In evidenza
MISC