# encoding: ascii
# api: powershell
# title: Asp.net-Using httpConext
# description: ASP.NET – Using httpContext
# version: 0.1
# type: class
# author: ti4funcom
# license: CC0
# x-poshcode-id: 2443
# x-archived: 2011-01-10T08:48:26
#
#
 Default.aspx
----------------


Partial Class _Default
Inherits System.Web.UI.Page

Dim var1 As String
Dim var2 As String

Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click
Context.Items("Nome") = var1
Context.Items("Email") = var2

Server.Transfer("pagina3.aspx")
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
var1 = "20091005"
var2 = "20091106"
End Sub
End Class


pagina3.aspx
--------------------------

Partial Class pagina3
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim context As HttpContext = HttpContext.Current

Label1.Text = CStr(context.Items("Nome"))
Label2.Text = CStr(context.Items("Email"))
End Sub
End Class
