Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/07/2014, 08:18
Avatar de santayita
santayita
 
Fecha de Ingreso: noviembre-2010
Mensajes: 88
Antigüedad: 13 años, 5 meses
Puntos: 1
jQuery con/sin MasterPage

Hola compañeros,
Mi problema es que tengo un script de jQuery para implementar un carrousel, y funciona perfectamente en paginas unicas .aspx pero en paginas con MasterPage no. Independientemente de donde coloque las librerias o donde ejecute la funcion, y desconozco el motivo.

Se comenta por el foro, y por la red, que las paginas que heredan de Master suelen dar este problema por las rutas, que son diferentes o algo asi entendi, pero creo que no es el caso al estar incluyendo los scripts y librerias directamente en la pagina, no?

Este codigo funciona correctamente
Código:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!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>
    <script type="text/javascript" src="js/jquery-1.2.1.pack.js"></script>
	<script type="text/javascript" src="js/jMyCarousel.js"></script>

    <script type="text/javascript">
        $(function () {

            $(".jMyCarousel").jMyCarousel({
                visible: '4',
                eltByElt: true,
                evtStart: 'mousedown',
                evtStop: 'mouseup'
            });

        });
	</script>


</head>
<body>

    
    p>Click on the buttons to animate this one !</p>
<div class="jMyCarousel">
    <ul>
        <li><img src="carousel_img/2/1.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/2.jpg" width="200" height="150"></li>
 		<li><img src="carousel_img/2/3.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/4.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/5.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/6.jpg" width="200" height="150"></li>
  </ul>
</div>
Y sin embargo este, con MP no.
Código:
%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script type="text/javascript" src="js/jquery-1.2.1.pack.js"></script>
	<script type="text/javascript" src="js/jMyCarousel.js"></script>
    <script type="text/javascript">
        $(function () {

            $(".jMyCarousel").jMyCarousel({
                visible: '4',
                eltByElt: true,
                evtStart: 'mousedown',
                evtStop: 'mouseup'
            });

        });
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
     <p>Click on the buttons to animate this one !</p>
<div class="jMyCarousel">
    <ul>
        <li><img src="carousel_img/2/1.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/2.jpg" width="200" height="150"></li>
 		<li><img src="carousel_img/2/3.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/4.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/5.jpg" width="200" height="150"></li>
        <li><img src="carousel_img/2/6.jpg" width="200" height="150"></li>
  </ul>
</div>
</asp:Content>
Espero vuestra respuesta y perdón si es algo repetido pero no conseguir entender muy bien las respuestas.
Gracias de antemano.
__________________
Error 404 - Firma not found