By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

asp and global variables

P: n/a
Hi

My first vb.net/asp.net application is taking shape now and I have started
using session state to store user variables or type string, long and bool..
The VB6 app I am converting also makes great use of global variables as per
the example below

Structure Gen_setup

Dim Nominal As Long

Dim TaxCode As Integer

Dim VATNo As String

End Structure

Public setups As Gen_setup

I want to convert this to session state, can anyone show me the best way.

Thanks in advance.


---
Outgoing mail is certified Virus Free, so am I.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I think this is what you are after.

public structure Gen_setup
Dim Nominal As Long
Dim TaxCode As Integer
Dim VATNo As String
Public Sub New(pNominal as long, pTaxCode as Integer, pVATNo as String)
Me.Nominal = pNominal
Me.TaxCode = pTaxCode
Me.VATNo = pVATNo
End Sub
end structure
Session["mySessionVar"] = new Gen_setup(21,6,"some string here")

"starbuck" <st******@mbssoft.co.uk> wrote in message news:uQ**************@tk2msftngp13.phx.gbl...
Hi

My first vb.net/asp.net application is taking shape now and I have started
using session state to store user variables or type string, long and bool..
The VB6 app I am converting also makes great use of global variables as per
the example below

Structure Gen_setup

Dim Nominal As Long

Dim TaxCode As Integer

Dim VATNo As String



End Structure

Public setups As Gen_setup

I want to convert this to session state, can anyone show me the best way.

Thanks in advance.




---
Outgoing mail is certified Virus Free, so am I.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004

Nov 18 '05 #2

P: n/a
You may want to add this attribute in case you ever use out of process session state (StateServer).
Then you classes and structures need to be serializable. May as well build it in up front.

<Serializable>_
public structure Gen_setup

--
Joe Fallon


"Darren Clark" <dc******@hotmail.com> wrote in message news:O6*************@TK2MSFTNGP10.phx.gbl...
I think this is what you are after.

public structure Gen_setup
Dim Nominal As Long
Dim TaxCode As Integer
Dim VATNo As String
Public Sub New(pNominal as long, pTaxCode as Integer, pVATNo as String)
Me.Nominal = pNominal
Me.TaxCode = pTaxCode
Me.VATNo = pVATNo
End Sub
end structure
Session["mySessionVar"] = new Gen_setup(21,6,"some string here")

"starbuck" <st******@mbssoft.co.uk> wrote in message news:uQ**************@tk2msftngp13.phx.gbl...
Hi

My first vb.net/asp.net application is taking shape now and I have started
using session state to store user variables or type string, long and bool..
The VB6 app I am converting also makes great use of global variables as per
the example below

Structure Gen_setup

Dim Nominal As Long

Dim TaxCode As Integer

Dim VATNo As String



End Structure

Public setups As Gen_setup

I want to convert this to session state, can anyone show me the best way.

Thanks in advance.




---
Outgoing mail is certified Virus Free, so am I.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.