Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session lock-up issue when requesting one webform from another.

Reply
Thread Tools

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

 
 
Thomas Nielsen [AM Production A/S]
Guest
Posts: n/a
 
      06-06-2004
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


 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      06-07-2004
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.)

 
Reply With Quote
 
 
 
 
Thomas Nielsen [AM Production A/S]
Guest
Posts: n/a
 
      06-07-2004
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.)
>



 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-07-2004
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.)

 
Reply With Quote
 
Cosmin Marin
Guest
Posts: n/a
 
      06-07-2004
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]" <(E-Mail Removed)> wrote in
message news:#(E-Mail Removed)...
> 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
>
>




 
Reply With Quote
 
Thomas Nielsen [AM Production A/S]
Guest
Posts: n/a
 
      06-07-2004
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.)
>



 
Reply With Quote
 
Thomas Nielsen [AM Production A/S]
Guest
Posts: n/a
 
      06-07-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in
> message news:#(E-Mail Removed)...
> > 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
> >
> >

>
>
>



 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-08-2004
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.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create an instance of one webform on another webform Paul ASP .Net 6 11-26-2009 04:45 PM
Does requesting a WebResource.axd extend Session andFormsAuthentication ticket? daokfella ASP .Net 1 08-28-2009 06:08 PM
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM



Advertisments