HighTechTalks DotNet Forums  

First AJAX PageMethod blocks second page method from executing

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss First AJAX PageMethod blocks second page method from executing in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?Um9nZXIgTWFydGlu?=
 
Posts: n/a

Default First AJAX PageMethod blocks second page method from executing - 07-24-2007 , 10:48 AM






In an earlier thread (http://tinyurl.com/33horg) I learned that when session
is enabled on a web page, a second page method is blocked until the first one
is complete.

Is there any way around this limitation, besides disabling session at the
page level?

Defining a method like the following doesn't solve the problem because
session is already disabled by default for a page method:

[System.Web.Services.WebMethod(EnableSession=false) ]
public static void WebMethod2()
{
System.Threading.Thread.Sleep(5000);
}

Thanks,
Roger Martin
Tech Info Systems / Gallery Server Pro
www.techinfosystems.com / www.galleryserverpro.com

Reply With Quote
  #2  
Old   
bruce barker
 
Posts: n/a

Default Re: First AJAX PageMethod blocks second page method from executing - 07-24-2007 , 11:43 AM






you could write your own session state provider that allowed concurrent
session access, but you'd need to change your pages to use locking
when accessing a session variable.

-- bruce (sqlwork.com)


Roger Martin wrote:
Quote:
In an earlier thread (http://tinyurl.com/33horg) I learned that when session
is enabled on a web page, a second page method is blocked until the first one
is complete.

Is there any way around this limitation, besides disabling session at the
page level?

Defining a method like the following doesn't solve the problem because
session is already disabled by default for a page method:

[System.Web.Services.WebMethod(EnableSession=false) ]
public static void WebMethod2()
{
System.Threading.Thread.Sleep(5000);
}

Thanks,
Roger Martin
Tech Info Systems / Gallery Server Pro
www.techinfosystems.com / www.galleryserverpro.com

Reply With Quote
  #3  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default RE: First AJAX PageMethod blocks second page method from executing - 07-25-2007 , 08:20 AM



Hi Roger,

If the page only needs read-only access to the session state, you can use
EnableSessionState="ReadOnly" to enable concurrent access to the session
state; otherwise, you will have to implement your own session state
provider as Bruce suggested.

You can find more information here:

#Session State Providers
http://msdn2.microsoft.com/en-us/library/Aa479034.aspx


Regards,
Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #4  
Old   
=?Utf-8?B?Um9nZXIgTWFydGlu?=
 
Posts: n/a

Default RE: First AJAX PageMethod blocks second page method from executing - 07-26-2007 , 06:48 PM



Thanks. I ended up modifying the page to not use session state.

Roger

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.