473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I need help with global variables

Hello Everybody

I am writing a web application using c#. I have several pages. I want
to create an Arraylist in one page fill it up and try to modify it in
another page. How do I do it?

Please help me

Lian
Nov 16 '05 #1
5 1119
You could use the HttpSessionState of the Page object.
ArrayList al
.....
base.Session ["MyKey"] = al;

This will be reached from any member page of the session.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lian" <li*****@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Hello Everybody

I am writing a web application using c#. I have several pages. I want
to create an Arraylist in one page fill it up and try to modify it in
another page. How do I do it?

Please help me

Lian

Nov 16 '05 #2
Hi,

Did you get so far that you can display the array on one page?

"Lian" wrote:
Hello Everybody

I am writing a web application using c#. I have several pages. I want
to create an Arraylist in one page fill it up and try to modify it in
another page. How do I do it?

Please help me

Lian

Nov 16 '05 #3

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4


yes I will try to be more specific. I created 2 web pages. in one i am
intiolaizing an Arraylist and I want the people will see it in another.
In addition I want that all the people that are logon could also change
data in the list array. Session could not help me cause it is just for
one user

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5
Then use a static instance of ArrayList, preferably declared
in Global.asax.cs.

public static System.Collections.ArrayList al = ...;

You can then reach it using
Global.al
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lian Bar" <li*****@hotmail.com> wrote in message
news:eJ*************@TK2MSFTNGP12.phx.gbl...


yes I will try to be more specific. I created 2 web pages. in one i am
intiolaizing an Arraylist and I want the people will see it in another.
In addition I want that all the people that are logon could also change
data in the list array. Session could not help me cause it is just for
one user

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sarmin kho | last post by:
Hi Pythoners, i have been using a lot of global variables in the python script i am working on. the global variables are shared and used by all various 'definitions' : def name (): global all...
2
by: Otto Wyss | last post by:
I have a string variable g_appname which should be global accessable by any class who whishes. I have defined it as wxString *g_appname = NULL; and fills it later on. Now a friend asked why I...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
13
by: Sunil | last post by:
Hi all, I want to know how good or bad it is using global variables i.e advantages and disadvantages of using global variables. Sunil.
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
4
by: Harry | last post by:
Good Day, I am writing a code for the H.264 Video codec.I am using VC++ compiler,but programming is in c only.I have grouped the related global variables under one structure in a header file...
3
by: sunbeam | last post by:
Short Description of the Project: we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
4
by: carl.dhalluin | last post by:
Hello I am completely puzzled why the following exec code does not work: mycode = "import math\ndef f(y):\n print math.floor(y)\nf(3.14)" def execute(): exec mycode execute()
43
by: Kislay | last post by:
Which of the following is correct regarding the storage of global variables : 1. Global variables exist in a memory area that exists from before the first reference in a program until after the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.