Erro using State Object
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngvb' list.


Roberson Fleck
-- Moved from [aspngstart] to [aspngvb] by devin <Click here to reveal e-mail address> --

Hello All:

I'm trying to use the State Object, but the Server retuns an =
Compilation
Error.

Code Example:=20

<%@ Page Language=3D"VB" clienttarget=3Duplevel %>

<html>

<script language=3D"VB" runat=3D"server">

Sub Page_Load(Sender As Object, E As EventArgs)
    If NOT Page.IsPostBack Then
        State("vezes") =3D 1
    Else
        State("vezes") =3D Cint(State("vezes")) + 1
    End If
    Ciclo_Vida.Text =3D Ciclo_Vida.Text & "<br>" & State("vezes") & "
Page_Load->"
End Sub

Sub Botao_Click(Sender As Object, E As EventArgs)
    Ciclo_Vida.Text =3D Ciclo_Vida.Text & "Botao_Click->"
End Sub

</script>

<body>

<form runat=3Dserver>
    <asp:button text=3D"Round Trip" Onclick=3D"Botao_Click" =
runat=3Dserver/>
    <br><asp:label id=3D"Ciclo_Vida" runat=3Dserver/>
</form>

</body>
</html>

Compilation Error:

Server Error in '/LIVRO' Application.=20
Compilation Error=20
Description: An error occurred during the compilation of a resource =
required
to service this request. Please review the following specific error =
details
and modify your source code appropriately.=20

Compiler Error Message: BC30451: Name 'State' is not declared.

Source Error:
Line 7: Sub Page_Load(Sender As Object, E As EventArgs)=20
Line 8: If NOT Page.IsPostBack Then=20
Line 9: State("vezes") =3D 1=20
Line 10: Else=20
Line 11: State("vezes") =3D Cint(State("vezes")) + 1

Anyone Can Help me ?

Thanks a lot !

Roberson Fleck
Web Developer Specialist
TIM - Tele Celular Sul
TIDS - Desenvolvimento de Solu=E7=F5es
Grupo Network Telecom
On Site +55 (41) 312-6989
Mobile +55 (41) 9953-2592
Email - Click here to reveal e-mail address
Web - http://www.timsul.com.br

Reply to this message...
 
    
Daniel Naumann
Roberson,

I think you might be after "Session". Or maybe "ViewState"...............

Daniel.

-----Original Message-----
From: Roberson Fleck [mailto:Click here to reveal e-mail address]
Sent: 07-Jun-2002 07:16
To: aspngvb
Subject: [aspngvb] Erro using State Object

-- Moved from [aspngstart] to [aspngvb] by devin
<Click here to reveal e-mail address> --

Hello All:

I'm trying to use the State Object, but the Server retuns an =
Compilation
Error.

Code Example:=20

<%@ Page Language=3D"VB" clienttarget=3Duplevel %>

<html>

<script language=3D"VB" runat=3D"server">

Sub Page_Load(Sender As Object, E As EventArgs)
    If NOT Page.IsPostBack Then
        State("vezes") =3D 1
    Else
        State("vezes") =3D Cint(State("vezes")) + 1
    End If
    Ciclo_Vida.Text =3D Ciclo_Vida.Text & "<br>" & State("vezes") & "
Page_Load->"
End Sub

Sub Botao_Click(Sender As Object, E As EventArgs)
    Ciclo_Vida.Text =3D Ciclo_Vida.Text & "Botao_Click->"
End Sub

</script>

<body>

<form runat=3Dserver>
    <asp:button text=3D"Round Trip" Onclick=3D"Botao_Click" =
runat=3Dserver/>
    <br><asp:label id=3D"Ciclo_Vida" runat=3Dserver/>
</form>

</body>
</html>

Compilation Error:

Server Error in '/LIVRO' Application.=20
Compilation Error=20
Description: An error occurred during the compilation of a resource =
required
to service this request. Please review the following specific error =
details
and modify your source code appropriately.=20

Compiler Error Message: BC30451: Name 'State' is not declared.

Source Error:
Line 7: Sub Page_Load(Sender As Object, E As EventArgs)=20
Line 8: If NOT Page.IsPostBack Then=20
Line 9: State("vezes") =3D 1=20
Line 10: Else=20
Line 11: State("vezes") =3D Cint(State("vezes")) + 1

Anyone Can Help me ?

Thanks a lot !

Roberson Fleck
Web Developer Specialist
TIM - Tele Celular Sul
TIDS - Desenvolvimento de Solu=E7=F5es
Grupo Network Telecom
On Site +55 (41) 312-6989
Mobile +55 (41) 9953-2592
Email - Click here to reveal e-mail address
Web - http://www.timsul.com.br

| [aspngvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngvb.asp = JOIN/QUIT

Reply to this message...
 
 
System.EventArgs
System.Web.UI.Page




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com