Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello
Im working with VB.NET on VS 2010 and I got a problem when this page run. After loading it does not execute any codebehind code. I check the Chrome's console and it gives me the next error message:


<img src="https://sites.google.com/site/t3st0t3st0/_/rsrc/1304012561598/home/err1.png"/>

I went to the source code bringed by chrome at righclick and checked the line 226 and found this:


<img src="https://sites.google.com/site/t3st0t3st0/_/rsrc/1304012919707/home/err2.png"/>


This is the sourcecode that I wrote in the aspx. I deleted and created this page many times and noted that the problem shows up after the updatepanel, scriptmanager, updateprogress are added and I run the page in a browser.

Thanks in advance for the help and sorry for my english and my coding.

XML
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Agenda.aspx.vb" Inherits="TribunalElectronico.Agenda" Culture="es-MX" %>

<!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>
    <link href="estilos.css" rel="stylesheet" type="text/css" />
    <link href="estilos_dock.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/interface.js"></script>
    <link href="../Acceso/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="../Acceso/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Acceso/jquery.ui.datepicker-es.js" type="text/javascript"></script>
    <script src="../Acceso/jquery.ui.core.js" type="text/javascript"></script>

</head>
<body>
   <script type="text/javascript">
       jQuery(document).ready(
        function () { $('#dock').Fisheye({ maxWidth: 40, items: 'a', itemsText: 'span', container: '.dock-container', itemWidth: 50, proximity: 90, halign: 'center' }) }
        );
    </script>
    <script language="javascript" type="text/javascript">
        $(function () {
            jQuery("#datepicker").datepicker({ minDate: 0 });
            $("#datepicker").datepicker(jQuery.datepicker.regional['es']);
            $("#rdbVencimiento").attr("checked", false);
            $("#rdbFecha").attr("checked", false);
        });
    </script>
    <script language="javascript" type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#btnBuscar").hide();
            jQuery("#datepicker").hide();
            jQuery("#cmbVencimiento").hide();
        }
        );
        </script>
        <script language="javascript" type="text/javascript">
            function hide() {
                jQuery("#btnBuscar").hide();
                jQuery("#datepicker").hide();
                jQuery("#cmbVencimiento").hide();
            }
            </script>
        <script language="javascript" type="text/javascript">
            function Pulso() {
                jQuery("#aaddevent").hide();
                jQuery("#aaddevent").fadeIn(500);
            }
        </script>
        <script language="javascript" type="text/javascript">
            function comportamiento(opcion) {

                if (opcion == 1) {
                    jQuery("#rdbFecha").attr("checked", false);
                    hide();
                    jQuery("#cmbVencimiento").fadeIn("slow");
                    jQuery("#btnBuscar").fadeIn("slow");
                }
                else
                    if (opcion == 2) {
                        jQuery("#rdbVencimiento").attr("checked", false);
                        hide();
                        jQuery("#datepicker").fadeIn("slow");
                        jQuery("#btnBuscar").fadeIn("slow");
                    }
            }

            function Busqueda() {
                if (jQuery("#rdbFecha").attr("checked") == true && jQuery("#rdbVencimiento").attr("checked") == false) {
                    if (jQuery("#datepicker").val() != "")
                    { return true; }
                    else {
                        alert("Introduzca una fecha válida");
                        return false;
                    }
                }

                else if (jQuery("#rdbFecha").attr("checked") == false && jQuery("#rdbVencimiento").attr("checked") == true) {
                    if (jQuery("#cmbVencimiento").val() == "1" || jQuery("#cmbVencimiento").val() == "2" || jQuery("#cmbVencimiento").val() == "3" || jQuery("#cmbVencimiento").val() == "4") {
                        return true;
                    }
                    else {
                        alert("Seleccione un tipo de vencimiento");
                        return false;
                    }
                }

                else {
                    if (jQuery("#rdbFecha").attr("checked") == true && jQuery("#rdbVencimiento").attr("checked") == true) {
                        alert("Favor de seleccionar un solo tipo de búsqueda");
                        return false;
                    }
                }
            }

            function dontwrite(e) {
                return false;
            }

            function AgregarEvento() {
                window.location.href = "";
            }


    </script>
    <script type="text/javascript" language="javascript" src="AccesoControlado.js" />
    <form id="form1" runat="server">
    <div>
    <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td><img src="img/ee_head1.png"  width="800" height="54" /></td>
            </tr>
        </table>
        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="542" height="64"><img src="img/ee_head2.png" width="542" height="64" /></td>
                <td width="186" height="64" background="img/ee_head3.png" valign="top"><br />
                <asp:Label ID="lblBienvenido" runat="server" Text="Bienvenido "></asp:Label>
                <asp:Label ID="lblNombre" runat="server" Text="Label"></asp:Label>
                    <br /></td>
                <td width="72" height="64"><img src="img/ee_head4.png" width="72" height="64" /></td>
            </tr>
        </table>
        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="800" height="10"><img src="img/ee_head5.png" width="800" height="10" /></td>
            </tr>
        </table>

        <table width="820" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="810" height="50">
                    <div class="dock" id="dock">
                        <div class="dock-container">
                            <a class="dock-item" href="Bandeja.aspx"><img src="images/inicio.png" alt="home" /><span>Inicio</span></a>
                            <a class="dock-item" href="ExpedientesAutorizados.aspx"><img src="images/expedientes.png" alt="contact" /><span>Mis Expedientes</span></a>
                            <a class="dock-item" href="AltaExpedientes.aspx"><img src="images/expedientes_alta.png" alt="portfolio" /><span>Alta de Expedientes</span></a>
                            <a class="dock-item" href="BandejaNPE.aspx"><img src="images/notificaciones.png" alt="music" /><span>Notificaciones Electrónicas</span></a>
                            <a class="dock-item" href="Promociones.aspx"><img src="images/promociones.png" alt="video" /><span>Promociones Electrónicas</span></a>
                            <a class="dock-item" href="#"><img src="images/quejas.png" alt="history" /><span>Quejas y/o Sugerencias</span></a>
                            <a class="dock-item" href="#"><img src="images/ayuda.png" alt="calendar" /><span>Ayuda</span></a>
                            <a class="dock-item" href="#"><img src="images/cambiar_pass.png" alt="rss" /><span>Cambiar Contrasena</span></a>
                        </div>
                        <span id="dock"></span>
                    </div>
                </td>
            </tr>
        </table>
        <!-------------------------------------cuerpo--------------------------------------------------------------------->
        <table width="800px" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td width="100px" height="50">
                    <a id="aaddevent" href="#" onmouseover="javascript:Pulso();" onclick="javascript:AgregarEvento();"><img src="images/addevent.png" alt="Agregar Evento" id="imgaddevent" /></a>
                </td>
                <td width="100px">
                    <img src="images/rotulo.png" id="imgrotulos" alt="imgplazos" />
                </td>
                <td width="600px"></td>
            </tr>
        </table>
        <table width="800px" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td align="left">

                    <asp:RadioButton ID="rdbVencimiento" runat="server" Text="Estado" onclick="comportamiento(1);" />
                    <asp:RadioButton ID="rdbFecha" runat="server" Text="Fecha" onclick="comportamiento(2);" />
                    &nbsp;
                    <asp:DropDownList ID="cmbVencimiento" runat="server">
                        <asp:ListItem Value="0">Seleccione</asp:ListItem>
                        <asp:ListItem Value="1">Normal</asp:ListItem>
                        <asp:ListItem Value="2">Alerta</asp:ListItem>
                        <asp:ListItem Value="3">Vencido</asp:ListItem>
                        <asp:ListItem Value="4">Realizado</asp:ListItem>
                    </asp:DropDownList>
                    <asp:TextBox ID="datepicker" runat="server" onKeyPress="javascript:return dontwrite();"></asp:TextBox>

                </td>
            </tr>
            <tr>
                <td>

                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                        <ProgressTemplate>
                            <asp:Image ID="Image1" runat="server" />
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <table align="left"><tr><td>
                                            <asp:Button ID="btnBuscar" runat="server" Text="Buscar" align="left" OnClientClick="javascript:return Busqueda()" /><br /></td></tr></table><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table align="center" width="800px">
                                            <tr>
                                                <td align="center">
                                                    <h3><asp:Label ID="lblLeyenda" runat="server" Text="Label"></asp:Label></h3>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center">
                                                    <asp:Table ID="lblAgenda" runat="server" Width="800px" CssClass="tabla_contenido"></asp:Table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
        <!-------------------------------------/cuerpo--------------------------------------------------------------------->
    </div>
    </form>
</body>
</html>
Posted
Updated 28-Apr-11 8:06am
v2
Comments
Ed Nutting 28-Apr-11 14:06pm    
Edit: Improved code so it displays pre block as lang=xml.

1 solution

The form's id attribute which is equal to form1 is not the same as the form id after being rendered to HTML. This is because the form as runAt="Server" attribute. Thus form1 is the name of the form on the server side i.e code behind. When the form get's rendered to HTML ASP.NET generates an id attribute for the HTML form tag.
It can be retrieved via <%= form1.ClientID %>.

Hope that helps some!

Cheers,

-MRB
 
Share this answer
 
v2
Comments
Nish Nishant 28-Apr-11 15:48pm    
My vote of 5!
Manfred Rudolf Bihy 29-Apr-11 3:31am    
Thanks Nishant!
Albin Abel 28-Apr-11 15:57pm    
Sharp catch and great effort . My 5
Manfred Rudolf Bihy 29-Apr-11 3:32am    
Thank you, Albin!
Sandeep Mewara 29-Apr-11 0:17am    
To the point! 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900