H
Hugo Lara
Hi, i´ve a problem with a NET application. In develop server, the
application runs without problems, but when I upload to our internet
webserver, fails with this message when i enter the information to
validate users. The error message is:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
FAE.VALIDACION.btnValidar_Click(Object sender, ImageClickEventArgs
e) +232
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs
e) +109
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
And the code of the webform is:
Public Class VALIDACION
Inherits System.Web.UI.Page
#Region " Código generado por el Diseñador de Web Forms "
'El Diseñador de Web Forms requiere esta llamada.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents Label21 As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents txtUsuario As
System.Web.UI.WebControls.TextBox
Protected WithEvents txtContrasenia As
System.Web.UI.WebControls.TextBox
Protected WithEvents lblUsuarioInc As
System.Web.UI.WebControls.Label
Protected WithEvents lblContraseniaInc As
System.Web.UI.WebControls.Label
Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
Protected WithEvents btnValidar As
System.Web.UI.WebControls.ImageButton
'NOTA: el Diseñador de Web Forms necesita la siguiente declaración
del marcador de posición.
'No se debe eliminar o mover.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: el Diseñador de Web Forms requiere esta llamada de
método
'No la modifique con el editor de código.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
lblUsuarioInc.Visible = False
lblContraseniaInc.Visible = False
If Not Page.IsPostBack Then
SetControlFocus(txtUsuario)
End If
End Sub
Private Sub btnValidar_Click(ByVal sender As System.Object, ByVal
e As System.Web.UI.ImageClickEventArgs) Handles btnValidar.Click
If txtUsuario.Text = "" Then
lblUsuarioInc.Visible = True
SetControlFocus(txtUsuario)
Else
Dim obj_cont As New CAPA_NEGOCIO.CONTRASENIAS(0,
txtUsuario.Text, "")
Dim ods_cont As DataSet
ods_cont = obj_cont.SeleccionarDS
If ods_cont.Tables(0).Rows.Count = 0 Then
lblUsuarioInc.Visible = True
SetControlFocus(txtUsuario)
Else
If txtContrasenia.Text = "" Then
txtContrasenia.Text = "..."
End If
obj_cont = New CAPA_NEGOCIO.CONTRASENIAS(0,
txtUsuario.Text, txtContrasenia.Text)
ods_cont = obj_cont.SeleccionarDS
If ods_cont.Tables(0).Rows.Count = 0 Then
lblContraseniaInc.Visible = True
SetControlFocus(txtContrasenia)
Else
Session("federacion") =
ods_cont.Tables(0).Rows(0).Item("idfederacion")
Response.Redirect("MENU_PPAL.aspx")
End If
End If
End If
End Sub
End Class
And the code of aspx page is:
<%@ Register TagPrefix="cc1" Namespace="MsgBox" Assembly="MsgBox" %>
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="VALIDACION.aspx.vb" Inherits="capausuario.VALIDACION"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>VALIDACION</title>
<meta name="vs_snapToGrid" content="True">
<LINK rel="stylesheet" type="text/css" href="Styles.css">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout" background="imgs/fondo.jpg">
<form id="Form1" method="post" runat="server">
<asp:label id="Label21" style="Z-INDEX: 102; LEFT: 192px; POSITION:
absolute; TOP: 136px" runat="server"
Height="24px" Width="96px" Font-Size="X-Small" Font-Bold="True"
ForeColor="Teal" BorderColor="Transparent">Contraseña:</asp:label>
<asp:Label id="lblContraseniaInc" style="Z-INDEX: 108; LEFT: 274px;
POSITION: absolute; TOP: 61px"
runat="server" ForeColor="White" Font-Bold="True"
Font-Size="Small" Width="226px" Height="24px"
BackColor="Teal">Contraseña Incorrecta !!</asp:Label>
<asp:TextBox id="txtContrasenia" style="Z-INDEX: 105; LEFT: 311px;
POSITION: absolute; TOP: 134px"
runat="server" Height="19px" Width="164px" MaxLength="5"
tabIndex="2" TextMode="Password"
BorderStyle="Inset" CssClass="textbox"></asp:TextBox>
<asp:label id="Label1" style="Z-INDEX: 103; LEFT: 192px; POSITION:
absolute; TOP: 104px" runat="server"
Height="24px" Width="72px" Font-Size="X-Small" Font-Bold="True"
ForeColor="Teal" BorderColor="Transparent">Usuario:</asp:label>
<asp:TextBox id="txtUsuario" style="Z-INDEX: 104; LEFT: 312px;
POSITION: absolute; TOP: 104px"
runat="server" Height="19px" Width="165px" tabIndex="1"
BorderStyle="Inset" CssClass="textbox"></asp:TextBox>
<asp:Label id="lblUsuarioInc" style="Z-INDEX: 107; LEFT: 296px;
POSITION: absolute; TOP: 61px"
runat="server" ForeColor="White" Font-Bold="True"
Font-Size="Small" Width="186px" Height="24px"
BackColor="Teal">Usuario Incorrecto !!</asp:Label>
<aspanel id="Panel1" style="Z-INDEX: 101; LEFT: 152px; POSITION:
absolute; TOP: 24px" runat="server"
BorderColor="Teal" Width="408px" Height="192px"
BackColor="Transparent" BorderStyle="Double"></aspanel>
<asp:ImageButton id="btnValidar" style="Z-INDEX: 110; LEFT: 416px;
POSITION: absolute; TOP: 176px"
runat="server" ImageUrl="imgs/validar.gif"
CausesValidation="False"></asp:ImageButton>
</form>
</body>
</HTML>
The Web.config file it´s ok
Know anyone why this error????
THX.
Hugo Lara Nevado
(e-mail address removed)
application runs without problems, but when I upload to our internet
webserver, fails with this message when i enter the information to
validate users. The error message is:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
FAE.VALIDACION.btnValidar_Click(Object sender, ImageClickEventArgs
e) +232
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs
e) +109
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
And the code of the webform is:
Public Class VALIDACION
Inherits System.Web.UI.Page
#Region " Código generado por el Diseñador de Web Forms "
'El Diseñador de Web Forms requiere esta llamada.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents Label21 As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents txtUsuario As
System.Web.UI.WebControls.TextBox
Protected WithEvents txtContrasenia As
System.Web.UI.WebControls.TextBox
Protected WithEvents lblUsuarioInc As
System.Web.UI.WebControls.Label
Protected WithEvents lblContraseniaInc As
System.Web.UI.WebControls.Label
Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
Protected WithEvents btnValidar As
System.Web.UI.WebControls.ImageButton
'NOTA: el Diseñador de Web Forms necesita la siguiente declaración
del marcador de posición.
'No se debe eliminar o mover.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: el Diseñador de Web Forms requiere esta llamada de
método
'No la modifique con el editor de código.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
lblUsuarioInc.Visible = False
lblContraseniaInc.Visible = False
If Not Page.IsPostBack Then
SetControlFocus(txtUsuario)
End If
End Sub
Private Sub btnValidar_Click(ByVal sender As System.Object, ByVal
e As System.Web.UI.ImageClickEventArgs) Handles btnValidar.Click
If txtUsuario.Text = "" Then
lblUsuarioInc.Visible = True
SetControlFocus(txtUsuario)
Else
Dim obj_cont As New CAPA_NEGOCIO.CONTRASENIAS(0,
txtUsuario.Text, "")
Dim ods_cont As DataSet
ods_cont = obj_cont.SeleccionarDS
If ods_cont.Tables(0).Rows.Count = 0 Then
lblUsuarioInc.Visible = True
SetControlFocus(txtUsuario)
Else
If txtContrasenia.Text = "" Then
txtContrasenia.Text = "..."
End If
obj_cont = New CAPA_NEGOCIO.CONTRASENIAS(0,
txtUsuario.Text, txtContrasenia.Text)
ods_cont = obj_cont.SeleccionarDS
If ods_cont.Tables(0).Rows.Count = 0 Then
lblContraseniaInc.Visible = True
SetControlFocus(txtContrasenia)
Else
Session("federacion") =
ods_cont.Tables(0).Rows(0).Item("idfederacion")
Response.Redirect("MENU_PPAL.aspx")
End If
End If
End If
End Sub
End Class
And the code of aspx page is:
<%@ Register TagPrefix="cc1" Namespace="MsgBox" Assembly="MsgBox" %>
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="VALIDACION.aspx.vb" Inherits="capausuario.VALIDACION"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>VALIDACION</title>
<meta name="vs_snapToGrid" content="True">
<LINK rel="stylesheet" type="text/css" href="Styles.css">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout" background="imgs/fondo.jpg">
<form id="Form1" method="post" runat="server">
<asp:label id="Label21" style="Z-INDEX: 102; LEFT: 192px; POSITION:
absolute; TOP: 136px" runat="server"
Height="24px" Width="96px" Font-Size="X-Small" Font-Bold="True"
ForeColor="Teal" BorderColor="Transparent">Contraseña:</asp:label>
<asp:Label id="lblContraseniaInc" style="Z-INDEX: 108; LEFT: 274px;
POSITION: absolute; TOP: 61px"
runat="server" ForeColor="White" Font-Bold="True"
Font-Size="Small" Width="226px" Height="24px"
BackColor="Teal">Contraseña Incorrecta !!</asp:Label>
<asp:TextBox id="txtContrasenia" style="Z-INDEX: 105; LEFT: 311px;
POSITION: absolute; TOP: 134px"
runat="server" Height="19px" Width="164px" MaxLength="5"
tabIndex="2" TextMode="Password"
BorderStyle="Inset" CssClass="textbox"></asp:TextBox>
<asp:label id="Label1" style="Z-INDEX: 103; LEFT: 192px; POSITION:
absolute; TOP: 104px" runat="server"
Height="24px" Width="72px" Font-Size="X-Small" Font-Bold="True"
ForeColor="Teal" BorderColor="Transparent">Usuario:</asp:label>
<asp:TextBox id="txtUsuario" style="Z-INDEX: 104; LEFT: 312px;
POSITION: absolute; TOP: 104px"
runat="server" Height="19px" Width="165px" tabIndex="1"
BorderStyle="Inset" CssClass="textbox"></asp:TextBox>
<asp:Label id="lblUsuarioInc" style="Z-INDEX: 107; LEFT: 296px;
POSITION: absolute; TOP: 61px"
runat="server" ForeColor="White" Font-Bold="True"
Font-Size="Small" Width="186px" Height="24px"
BackColor="Teal">Usuario Incorrecto !!</asp:Label>
<aspanel id="Panel1" style="Z-INDEX: 101; LEFT: 152px; POSITION:
absolute; TOP: 24px" runat="server"
BorderColor="Teal" Width="408px" Height="192px"
BackColor="Transparent" BorderStyle="Double"></aspanel>
<asp:ImageButton id="btnValidar" style="Z-INDEX: 110; LEFT: 416px;
POSITION: absolute; TOP: 176px"
runat="server" ImageUrl="imgs/validar.gif"
CausesValidation="False"></asp:ImageButton>
</form>
</body>
</HTML>
The Web.config file it´s ok
Know anyone why this error????
THX.
Hugo Lara Nevado
(e-mail address removed)