Usuario
Como puedo llamar un label que esta en un contentplaceholder con js

Pregunta
-
Tengo problemas para poder cambier el texto de un label con java script no se mucho de ello y no se si lo este haciendo bien, aqui esta mi codigo
PRUEBA.aspx<%@ Page Title="" Language="VB" MasterPageFile="~/Master page inicio/Prueba.master" AutoEventWireup="false" CodeFile="prueba3.aspx.vb" Inherits="prueba3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cabecera" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Menu" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Descuent" Runat="Server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>A jQuery Confirm Dialog Replacement with CSS3 | Tutorialzine Demo</title>
<link href='http://fonts.googleapis.com/css?family=Cuprum&subset=latin' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/styles1.css" />
<link rel="stylesheet" type="text/css" href="jquery.confirm/jquery.confirm.css" />
<link rel="stylesheet" type="text/css" href="http://www.newsmartwave.net/magento/porto/js/smartwave/ajaxcart/ajaxaddto.css">
<link rel="stylesheet" type="text/css" href="http://www.newsmartwave.net/magento/porto/skin/frontend/smartwave/porto/icons/css/animation.css" media="all">
<link rel="stylesheet" type="text/css" href="http://www.newsmartwave.net/magento/porto/skin/frontend/smartwave/porto/css/local.css" media="all">
<div id="holii">
<asp:Label ID="ctl00_Descuent_lblDpto" Style="color: #CCCC00; font: bold 18px arial; width: auto; ; top:4px;" runat="server" Text="holiwis"></asp:Label>
</div>
<div id="page">
<div class="item">
<div class="delete"></div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="jquery.confirm/jquery.confirm.js"></script>
<script src="js/script.js"></script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Paginador" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="listaproc" Runat="Server">
</asp:Content>
MASTER PAGE
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Plomelecc - Categoría</title>
<%-- Bloqueado--%>
<link href="../css/Promociones.css" rel="stylesheet" />
<!-- Bootstrap -->
<!-- BLoqueado-->
<link href="../css/bootstrap.css" rel="stylesheet" />
<%-- <link href="../css/bootstrap-header.css" rel="stylesheet" />--%>
<%-- Bloqueado--%>
<%-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,800" rel="stylesheet" type="text/css">--%>
<%-- Bloqueado--%>
<%-- <script src="../js/bootstrap.js"></script> --%>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Empieza Cabecera -->
<form runat="server">
<header id="header">
<asp:ContentPlaceHolder ID="cabecera" runat="server">
</asp:ContentPlaceHolder>
</header>
<!-- Termina Cabecera -->
<div class="column2 column2-left-sidebar boxed no-breadcrumbs" id="main">
<div class="container">
<div class="row">
<div class="col-md-3 sidebar left-sidebar">
<div class="widget-sidebar-menu">
<!-- Menu Categorias -->
<asp:ContentPlaceHolder ID="Menu" runat="server">
</asp:ContentPlaceHolder>
</div>
<asp:ContentPlaceHolder ID="Descuent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="main-content col-md-9 col-xs-12">
<!-- Listado de productos, 9 por página -->
<div class="col-md-12 categoria">
<asp:ContentPlaceHolder ID="Paginador" runat="server">
</asp:ContentPlaceHolder>
</div>
<asp:ContentPlaceHolder ID="listaproc" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<!-- Segunda fila -->
<!-- Tercer fila -->
<!-- Cuarta fila -->
<div class="espacio-vacio"></div>
<!-- Herramientas Abajo -->
<!-- Fin-->
</div>
</div>
<div class="footer" style="background:#626261;">
<div class="container">
<div class="footer-centro">
<p><img src="images/pagos.png"></p>
<p>© Copyright 2016. Todos los derechos reservados.</p>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- bloqueado -->
<%-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>--%>
</form>
</body></html>
script.js
$(document).ready(function () {
$('.item .delete').click(function () {
var elem = $(this).closest('.item');
$.confirm({
'title': 'Delete Confirmation',
'message': 'You are about to delete this item. <br />It cannot be restored at a later time! Continue?',
'buttons': {
'Go to cart page': {
'class': 'btn-default',
'action': window.onload = function () {
// elem.slideUp();
//PlomPag2.DisplayDate();
//__doPostBack('finish_and_checkout');
var mivariable = "hello every body";
if (document.getElementById("ctl00_Descuent_lblDpto").textContent != null) {
// document.all("ctl00_Descuent_lblDpto").innerHTML = "hello every body";
document.getElementById("ctl00_Descuent_lblDpto") = mivariable;
}
}
},
'Continue': {
'class': ' btn-default',
'action': function () { } // Nothing to do in this case. You can as well omit the action property.
}
}
});
});
});JQUERY.CONFIRM
(function ($) {
$.confirm = function (params) {
if ($('#confirmOverlay').length) {
// A confirm is already shown on the page:
return false;
}
var buttonHTML = '';
$.each(params.buttons, function (name, obj) {
//<button type="button" name="finish_and_checkout" id="finish_and_checkout" class="button btn-cart"><span><span>
// Go to cart page </span></span></button>
// Generating the markup for the buttons:
buttonHTML += '<button type="button" name="finish_and_checkout" id="finish_and_checkout" style="margin-margin-right: 5px;" class="btn ' + obj['class'] + '"><span><span>' + name + '</span></span></button>';
if (!obj.action) {
obj.action = function () { };
}
});
var markup = [
'<div id="confirmOverlay">',
'<div id="success-message-container">',
'<div class="msg-box"><div class="msg">producto:<p class="product-name theme-color">Black Maxi Dress</p><div class="timer theme-color">5</div><img src="http://www.newsmartwave.net/magento/porto/media/catalog/product/cache/11/small_image/250x/17f82f742ffe127f42dca9de82fb58b1/f/a/fashion-10-1.jpg" class="product-image" alt=""></div>',
buttonHTML,
'</div></div></div>'
].join('');
$(markup).hide().appendTo('body').fadeIn();
var buttons = $('#success-message-container .btn'),
i = 0;
$.each(params.buttons, function (name, obj) {
buttons.eq(i++).click(function () {
// Calling the action attribute when a
// click occurs, and hiding the confirm.
obj.action();
$.confirm.hide();
return false;
});
});
}
$.confirm.hide = function () {
$('#confirmOverlay').fadeOut(function () {
$(this).remove();
});
}
})(jQuery);