473,421 Members | 1,685 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,421 software developers and data experts.

application and client session - where to code?

I am new to web programming.

I am trying to do an ASP .NET reservations application. I need to create
only one dataset and all the clients are supposed to use only that dataset.
Moreover, I need to create an array that can be accessed by all clients.

In short : As long as the application is running there should be only one
dataset and one array.

Earlier I have read about something about application session and client
session.

If I want array, dataset etc to last throughout the life of the application
and be common to all the clients who are accessing it..... which part of
the code should I create all this?

Given below is the skeletal version of my program. Could you please let me
know
1. For application session, in which the item is common to all clients,
which part of the code should I plug in all this?

2. If it is for client session - where the item is user specific and should
be destroyed after the user session is over - In which section of the code
should I build it?

Thank you.

Regards,
Li

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace RoomBookingApp
{
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
}// private void Page_Load
public void Calendar1_DayRender(object source, DayRenderEventArgs e)
{
} //public void Calendar1_DayRender

public void Calendar2_DayRender(object source, DayRenderEventArgs e)
{
} //public void Calendar2_DayRender

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
}
#endregion

private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{
}

private void Calendar2_SelectionChanged(object sender, System.EventArgs e)
{
}
} //public class WebForm1 : System.Web.UI.Page
}//namespace RoomBookingApp
Nov 19 '05 #1
3 1059
Use the Application object, or if you want to get fancy you can use the
Cache object (which is similar but has extra features.)
You might want to fill the application object in your Application_OnStart
event (in your global.asax.cs)
Then you can retrieve the value whenever and wherever you need it, often
times in the Page_Load event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Likhith Areekkal" <li*********@sympatico.ca> wrote in message
news:Kt********************@news20.bellglobal.com. ..
I am new to web programming.

I am trying to do an ASP .NET reservations application. I need to create
only one dataset and all the clients are supposed to use only that
dataset. Moreover, I need to create an array that can be accessed by all
clients.

In short : As long as the application is running there should be only one
dataset and one array.

Earlier I have read about something about application session and client
session.

If I want array, dataset etc to last throughout the life of the
application and be common to all the clients who are accessing it.....
which part of the code should I create all this?

Given below is the skeletal version of my program. Could you please let me
know
1. For application session, in which the item is common to all clients,
which part of the code should I plug in all this?

2. If it is for client session - where the item is user specific and
should be destroyed after the user session is over - In which section of
the code should I build it?

Thank you.

Regards,
Li

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace RoomBookingApp
{
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
}// private void Page_Load
public void Calendar1_DayRender(object source, DayRenderEventArgs e)
{
} //public void Calendar1_DayRender

public void Calendar2_DayRender(object source, DayRenderEventArgs e)
{
} //public void Calendar2_DayRender

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
}
#endregion

private void Calendar1_SelectionChanged(object sender, System.EventArgs
e)
{
}

private void Calendar2_SelectionChanged(object sender, System.EventArgs
e)
{
}
} //public class WebForm1 : System.Web.UI.Page
}//namespace RoomBookingApp

Nov 19 '05 #2
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Use the Application object, or if you want to get fancy you can use the
Cache object (which is similar but has extra features.)
You might want to fill the application object in your Application_OnStart
event (in your global.asax.cs)
Then you can retrieve the value whenever and wherever you need it, often
times in the Page_Load event.


If you really need to keep a single copy of the data, then you should use
Application state.

Note, however, that Application state can be accessed by multiple requests
at the same time. You must synchronize access to this data. Take a look at
the SyncLock statement in VB.NET or the lock statement in C#.

John Saunders
Nov 19 '05 #3
Thank you for the guidance. I appreciate it.


"Likhith Areekkal" <li*********@sympatico.ca> wrote in message
news:Kt********************@news20.bellglobal.com. ..
I am new to web programming.

I am trying to do an ASP .NET reservations application. I need to create
only one dataset and all the clients are supposed to use only that
dataset. Moreover, I need to create an array that can be accessed by all
clients.

Nov 19 '05 #4

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

Similar topics

33
by: aa | last post by:
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters. Is there a similar...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
8
by: Anthony P. Mancini | last post by:
I'm working on a proof of concept that will ultimately be deployed on a load balancer. For the sake of a preliminary demonstration I created a C# object and marked it's attributes as Public...
7
by: Pavils Jurjans | last post by:
Hello, I wanted to get some light in the subject. As I develop ASP.NET applications, it's necessary to understand how exactly the server- communication happens. It seems like initially...
4
by: Trevor Andrew | last post by:
Hi There, Hopefully this isn't too difficult a question to express here. I have a 3 tier application. 1. Presentation Tier: ASP.NET web application. 2. Middle Tier: ASP.NET Web Services that...
11
by: Sylvia A. | last post by:
How can I define global classes in web application ? Classes can be set to session variables ? Thanks
4
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
0
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.