.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification