ysimon
asked on
How can I use a global variable in multiple pages in IntraWeb for .NET?
I am using IntraWeb in a project of Delphi 2005 for.NET
I can not use a global variable between 2 pages. The methods for VCL applications can not be used here.
Is anyone using IntraWeb? Please help me, thanks,
ysimon
I can not use a global variable between 2 pages. The methods for VCL applications can not be used here.
Is anyone using IntraWeb? Please help me, thanks,
ysimon
ASKER
In normal IntraWeb Web Page project, there is a Session form we can used to set variables. However, there is no any such thing in IntraWeb for Delphi.NET
ysimon
ysimon
but in a .NET application you can just use the Session state
Session['YourVariable']:=T heValue
or
Context.Session['YourVaria ble']:=The Value
you need to include System.Web.SessionState in your uses
Session['YourVariable']:=T
or
Context.Session['YourVaria
you need to include System.Web.SessionState in your uses
ASKER
Hi BlackTigerX,
How do I define a variable type?
if a variable is defined in MainForm, can I use it in other web form?
ysimon
How do I define a variable type?
if a variable is defined in MainForm, can I use it in other web form?
ysimon
yes, as long as the types are compatible, you can use the same session variable in any number of forms
Context.Session['YourVaria ble']:=The Value //TheValue can be string, int, a dataset, any object...
then in another form
AnotherVariableOfTheSameTy pe:=Contex t.Session[ 'YourVaria ble'];
Context.Session['YourVaria
then in another form
AnotherVariableOfTheSameTy
ASKER
After I put
Context.Session['Num']:=12 3;
in the MainForm, I got
[Fatal Error] F2084 Internal Error: ILLK8154
when it was compiled
The left side is an Object, how can I input a value on it?
ysimon
Context.Session['Num']:=12
in the MainForm, I got
[Fatal Error] F2084 Internal Error: ILLK8154
when it was compiled
The left side is an Object, how can I input a value on it?
ysimon
ASKER
Any one know how to use Session to set global variables between the PageForms of IntraWeb for .NET?
Help!!!
ysimon
Help!!!
ysimon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
* store an encrypted hidden string between pages
* session variable -- I think .Net provides some native libraries for this
* cookies
Note: I'm a bit out of my league, since I don't have D2005/Intraweb experience. I'm just suggesting work-arounds.