Here is the code. Thank you for your help
Imports Vivo.DBAccess
Public Class CorporacionesMod
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents lblUserInfo As System.Web.UI.WebControls.Label
Protected WithEvents cmdLogOff As System.Web.UI.WebControls.ImageButton
Protected WithEvents RequiredFieldValidator2 As
System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents txtNombre As System.Web.UI.WebControls.TextBox
Protected WithEvents cmdSave As System.Web.UI.WebControls.Button
Protected WithEvents ValidationSummary1 As
System.Web.UI.WebControls.ValidationSummary
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Shared objCorporacion As Corporacion
Private Shared MyUser As New User
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Session("LoggedOn") = False Then
Response.Redirect("../UserLogin.aspx")
Exit Sub
End If
MyUser = CType(Session("User"), User)
Dim MyCorp As New Corporacion(MyUser.IdCorporacion)
lblUserInfo.Text = MyUser.NombreCompleto & "<BR>" & MyCorp.Nombre
If MyUser.Super = False Then
Response.Redirect("NoAccess.aspx")
End If
If Not (Page.IsPostBack) Then
objCorporacion = New Corporacion(Request.Params("IdCorporacion"))
txtNombre.Text = objCorporacion.Nombre
End If
End Sub
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSave.Click
Session("ResultMessage") = objCorporacion.Update(objCorporacion.ID,
txtNombre.Text)
Response.Redirect("Result.aspx?RedirectPage=Corpor aciones.aspx")
End Sub
Private Sub cmdLogOff_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles cmdLogOff.Click
Session("LoggedOn") = False
Session.Abandon()
Response.Redirect("../Gracias.aspx")
End Sub
End Class
Thanks,
"CCORDON" <tc******@hotmail.com> wrote in message
news:uO**************@TK2MSFTNGP11.phx.gbl...
I have some classes that contain my objects...say..... Client...with all
his properties, Methods & Events. I use this on my web pages like this.
Dim MyClient as New Client(IdCorporation)
This because I need the information of that client as a reference.
Then I use:
If not page.IsPostBack then
Dim MyOtherClient as New Client ()
This is created just to use a function from that class:
MyOtherClient.Add (Name, Address, City, Zip, Phone)
Endif
The problem is that when a postback occurs...MyOtherClient = MyClient.
How should this be handled?
Thanks