[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 809
  • Last Modified:

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
0
ysimon
Asked:
ysimon
1 Solution
 
aikimarkCommented:
alternatives to consider:
* 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.
0
 
ysimonAuthor Commented:
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
0
 
BlackTigerXCommented:
but in a .NET application you can just use the Session state

Session['YourVariable']:=TheValue
or
Context.Session['YourVariable']:=TheValue

you need to include System.Web.SessionState in  your uses
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
ysimonAuthor Commented:
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
0
 
BlackTigerXCommented:
yes, as long as the types are compatible, you can use the same session variable in any number of forms

Context.Session['YourVariable']:=TheValue //TheValue can be string, int, a dataset, any object...

then in another form

AnotherVariableOfTheSameType:=Context.Session['YourVariable'];
0
 
ysimonAuthor Commented:
After I put
Context.Session['Num']:=123;
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
0
 
ysimonAuthor Commented:
Any one know how to use Session to set global variables between the PageForms of IntraWeb for .NET?
Help!!!
ysimon
0
 
moduloCommented:
PAQed with points refunded (200)

modulo
Community Support Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now