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

Passing session data across applications.

My objective was to implement a 'Wait' page by using a combination of
an asynchronous call and a Session variable to signal the end of the
wait.

My first page has:
---------------------------------------------------------------
private void cmdSubmit_Click(object sender, System.EventArgs e)
{
Thread LongProcessThread = new Thread(new ThreadStart(LongProcess));

Session["Progress"] = "";
LongProcessThread.Start();
Session["NextPage"] = "Wait.aspx";
Response.Redirect("Wait.aspx");
}
private void LongProcess()
{
Random rand = new Random();

// long process simulation:
Thread.Sleep(5000 + (int)(10000.0 * rand.Next() / Int32.MaxValue));
Session["NextPage"] = "JobSubmitted.ASPx";
}
---------------------------------------------------------------

My second 'Wait' page has:
---------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
if (null == Session["NextPage"])
Response.End();

string strNextPage = Session["NextPage"].ToString();
if ("" == strNextPage || "wait.aspx" == strNextPage.ToLower())
{
lblProgress.Text = Session["Progress"] + char.ToString((char)9608);
Session["Progress"] = lblProgress.Text;
}
else
Response.Redirect(strNextPage);
}
---------------------------------------------------------

These two pages work well and do what I want.

The problem now is that I want the second/wait page to be shared by
different applications. The above code would not work since Session
variables do not persist across applications. Any ideas, suggestions,
solutions?

TIA.
Nov 18 '05 #1
1 2182
Hi,

You can persist the session data in Database or additionally persist the
session data in memory map file. You can use Microsoft cache application
block to store and retrieve data from memory map file. :

http://msdn.microsoft.com/library/de.../en-us/dnpag/h
tml/CachingBlock.asp

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

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

Similar topics

2
by: Brad | last post by:
Hi everyone, I've been using ASP on a few different projects over the past year, either using Javascript or VBScript. During that time, I've made use of session variables, but even then, I've...
6
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server...
4
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in...
3
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net...
3
by: A Ward | last post by:
I am trying to find a way to have multiple seperate ASP.Net applications where I can response.redirect() to a second web application and pass information. From what I have tried: * HTTP-GET - I...
1
by: guoqi zheng | last post by:
I have an application in IIS with a few sub domains assign to it. Is there a way for me to share session data across those subdomains? regards, Guoqi Zheng http://www.ureader.com
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
2
by: Ahmed | last post by:
Dear All, I have three web applications that I want to provide one single web interface to all of them. If I am able to share the session between them, It will be great. so is this possibel?
2
by: Roy | last post by:
Hey all, Is it possible to pass session variables between pages in separate projects? For example: inetpub\thisproject\blah.aspx has a session variable and response.redirects the user to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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?
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...

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.