Storage Scopes CodeSample - Combining static class properties and context or session variables
Categories: State Serialization, Session Serialization
|
Tags: Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
Revision:
1
Posted:
08/Nov/2009
Updated:
23/July/2010
Status:
Publish
Types: Article
|
This article will have a few sections added to it soon, based on the following article type skeleton: CodeSample Overview
This CodeSample, a part of the Storage Scopes series of articles, will show how creating static class properties that access Context or Session variables, can in some cases be a nice idea to optimize code, as you do not need to create instances of the class to be able to access the properties and yet you are accessing non-static contents from either the Context or Session scope. VB.NET Code
Imports Gizmox.WebGui.Forms
Public Class LoginInfo
Public Shared Property Username() As String
Get
Return VWGContext.Current.Session("Username")
End Get
Set(ByVal value As String)
VWGContext.Current.Session("Username") = value
End Set
End Property
End Class
Imports Gizmox.WebGui.Forms
Public Class ShowStorateScopes
Inherits Form
Private Sub ShowStorateScopes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoginInfo.Username = "JohnDoe"
End Sub
Private Sub btnShowUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowUser.Click
MessageBox.Show(LoginInfo.Username)
End Sub
End Class
C# Code
The conversion of this code to C# has not been completed yet.
ReferecnesArticlesForum Threads
About the author
Related Articles
|
State Serialization
|
|
|
Tags:
Architects, Developers, Visual WebGui Pipeline, 2. Intermediate, 3. Advanced, Optimizing Performance, Pre v6.3, v6.3, v6.4 and Later
|
|
|
Tags:
Architects, Developers, Visual WebGui Pipeline, 2. Intermediate, 3. Advanced, Optimizing Performance, v6.4 and Later
|
|
|
Tags:
Architects, Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
|
|
|
Tags:
Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
|
|
|
Tags:
Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
|
|
|
Tags:
Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
|
|
|
|