?
Solved

How can I use a global variable in multiple pages in IntraWeb for .NET?

Posted on 2005-03-13
9
Medium Priority
?
785 Views
Last Modified: 2008-02-01
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
Comment
Question by:ysimon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 13528464
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
 

Author Comment

by:ysimon
ID: 13530195
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
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13536214
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ysimon
ID: 13539729
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
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13540079
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
 

Author Comment

by:ysimon
ID: 13540569
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
 

Author Comment

by:ysimon
ID: 13550030
Any one know how to use Session to set global variables between the PageForms of IntraWeb for .NET?
Help!!!
ysimon
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14830284
PAQed with points refunded (200)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question