473,378 Members | 1,493 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.

Session lock-up issue when requesting one webform from another.

Hi,

I have one web form (WebForm1.aspx) from which i would like to display the
output of another web form, WebForm2.aspx, in a controlled environment. I do
this by using HttpWebRequest to request WebForm2 from the WebForm1
code-behind, and this works flawlessly.

I would also like to be able to share the Session objects between the two
webforms. I'm trying to do this by passing the ASP.NET_SessionId cookie on
WebForm1 to WebForm2. This should trick IIS into believing both requests are
within the same session.
However, it seems that IIS locks up WebForm2 (it doesn't respond) when the
session ID for both forms is identical. It should be noted that both web
forms are placed in the same web application, and that i suspect this is the
reason for the lock-up. I've tried placing WebForm2 in a different web
application, and then there are no lock-up problems - But then they are
ofcourse not sharing sessions even though their session IDs are identical.

Any hints would be appreciated.

Cheers,

/Thomas
Nov 18 '05 #1
7 1520
Hi Thomas,

Can you explain more about why you need to dispaly content from another web
form? In such a situation, I would like suggest a asp.net web control
instead. For example, you can easily convert the second web form to a web
control and used it in the first web form. Can this resolve the problem?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
Luke,

I realize the solution is "exotic", but the reason is that my first WebForm
is part of a proprietary system that i do not fully control. For example -
There are currently problems using Viewstate within this system, and this
would affect whichever User Controls i would (dynamically) load on to the
page.

If I were able to completely isolated "execute" WebForms from within the
system, I would be able to avoid taking host system-specific issues into
consideration. I would also be able to insert content from any external
webservers into my page, which would also be an advantage for me.

Cheers,

/Thomas


"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:dT*************@cpmsftngxa10.phx.gbl...
Hi Thomas,

Can you explain more about why you need to dispaly content from another web form? In such a situation, I would like suggest a asp.net web control
instead. For example, you can easily convert the second web form to a web
control and used it in the first web form. Can this resolve the problem?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Hi Thomas,

Actually, we cannot isolate the "execute" in that way. All request will be
handle in same process (ASP.NET).

To get around this problem, I think you may consider adding the session
variant to QueryString or Form of the request, so that the target web form
can get the value.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4
Luke,

Not quite sure i follow you on this one. Why is it a problem (to the Session
object) that both requests are handled from within the same process?.

/Thomas

"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:E0*************@cpmsftngxa10.phx.gbl...
Hi Thomas,

Actually, we cannot isolate the "execute" in that way. All request will be
handle in same process (ASP.NET).

To get around this problem, I think you may consider adding the session
variant to QueryString or Form of the request, so that the target web form
can get the value.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
Hi,

If you really need access to session in both forms, you could try
Server.Execute() from within WebForm1 to render WebForm2. We might loose
some stuff like url authorization, if you are using it.
The problem you are experiencing comes from the fact that the session is
locked during the lifetime of a request that asks for access to the
session. The lock type depends on the type of access that you want (r/w or
r/o), but as soon as you ask fo r/w access, you have the requests on the
same session serialized.

Cosmin

"Thomas Nielsen [AM Production A/S]" <ja*********@h0tmail.com> wrote in
message news:#s**************@tk2msftngp13.phx.gbl...
Hi,

I have one web form (WebForm1.aspx) from which i would like to display the
output of another web form, WebForm2.aspx, in a controlled environment. I do this by using HttpWebRequest to request WebForm2 from the WebForm1
code-behind, and this works flawlessly.

I would also like to be able to share the Session objects between the two
webforms. I'm trying to do this by passing the ASP.NET_SessionId cookie on
WebForm1 to WebForm2. This should trick IIS into believing both requests are within the same session.
However, it seems that IIS locks up WebForm2 (it doesn't respond) when the
session ID for both forms is identical. It should be noted that both web
forms are placed in the same web application, and that i suspect this is the reason for the lock-up. I've tried placing WebForm2 in a different web
application, and then there are no lock-up problems - But then they are
ofcourse not sharing sessions even though their session IDs are identical.

Any hints would be appreciated.

Cheers,

/Thomas


Nov 18 '05 #6
Cosmin,

OK - That explains my problems. There's no way you know of that will allow
me to force unlocking the session?

I was considering Server.Execute too, but then everything is inherited from
the page which i execute from (for instance, Viewstate may be switched off
from WebForm1). I would rather be able to "sandbox" execute/render my forms
into this one form.

Cheers,

/Thomas
"Cosmin Marin" <no****@nospam.ro> wrote in message
news:uX**************@TK2MSFTNGP10.phx.gbl...
Hi,

If you really need access to session in both forms, you could try
Server.Execute() from within WebForm1 to render WebForm2. We might loose
some stuff like url authorization, if you are using it.
The problem you are experiencing comes from the fact that the session is
locked during the lifetime of a request that asks for access to the
session. The lock type depends on the type of access that you want (r/w or
r/o), but as soon as you ask fo r/w access, you have the requests on the
same session serialized.

Cosmin

"Thomas Nielsen [AM Production A/S]" <ja*********@h0tmail.com> wrote in
message news:#s**************@tk2msftngp13.phx.gbl...
Hi,

I have one web form (WebForm1.aspx) from which i would like to display the output of another web form, WebForm2.aspx, in a controlled environment. I
do
this by using HttpWebRequest to request WebForm2 from the WebForm1
code-behind, and this works flawlessly.

I would also like to be able to share the Session objects between the

two webforms. I'm trying to do this by passing the ASP.NET_SessionId cookie on WebForm1 to WebForm2. This should trick IIS into believing both requests

are
within the same session.
However, it seems that IIS locks up WebForm2 (it doesn't respond) when the session ID for both forms is identical. It should be noted that both web
forms are placed in the same web application, and that i suspect this is

the
reason for the lock-up. I've tried placing WebForm2 in a different web
application, and then there are no lock-up problems - But then they are
ofcourse not sharing sessions even though their session IDs are identical.
Any hints would be appreciated.

Cheers,

/Thomas


Nov 18 '05 #7
Thank you Cosmin's answer. I agee with him too. And I don't think there is
way to force unlocking the session. You may need to find other ways to
share the data between the pages.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #8

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

Similar topics

0
by: Rafael | last post by:
I have session lock mechanism to limit the usage of a web app. I did a stress tool to validate the lock mechanism. This stress tools creates new thread for each access, but the ServicePointManager...
2
by: yabba | last post by:
w2k server as webadmin i have occasion to kill a user session and couse them to login again. I have the sessionID saved in a file. is there a way to kill the user session without disturbing...
3
by: Marcus | last post by:
Hello all, I have written numerous functions that check all user entered data on my site via POST and GET. My question is this: once my data checks out as being valid, I sometimes store it in...
3
by: Tom | last post by:
Hi I have a web application using asp.net and c#. User has to login to the application with his username and pwd. However, I do not allow other user uses the same username and pwd to login, i.e....
6
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the...
3
by: Jazper | last post by:
hi i'd like to be able to access the same objects in the session but by different applications on the same webserver. example: C#-WebApp creates Session-Object "xxx" and redirect to a...
2
by: Gavin Lyons via .NET 247 | last post by:
Hello, I'm writing a newsletter application which uses backgroundthreading. I'm using Session variable to report on progresswhile it loops through a dataset. The 'Status.aspx' pagerefreshes every...
2
by: Kevin Frey | last post by:
Hello, I've been reading that ASP.NET serialises (ie. processes one at a time) HTTP requests if two simultaneous requests need to access the same session state. It also makes note that ASP.NET...
2
by: exhuma.twn | last post by:
Hi again, as soon as I try to make use of the "session" object inside a psp-template file, I get the following error: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most...
3
by: jamesnkk | last post by:
Hi, every time I run the below statement, it display error message "Could not Update , currently lock by other session in this computer. I am running on a stand-alone PC. Dim rst As New...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.