473,748 Members | 3,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

First AJAX PageMethod blocks second page method from executing

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.Serv ices.WebMethod( EnableSession=f alse)]
public static void WebMethod2()
{
System.Threadin g.Thread.Sleep( 5000);
}

Thanks,
Roger Martin
Tech Info Systems / Gallery Server Pro
www.techinfosystems.com / www.galleryserverpro.com
Jul 24 '07 #1
3 3281
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:
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.Serv ices.WebMethod( EnableSession=f alse)]
public static void WebMethod2()
{
System.Threadin g.Thread.Sleep( 5000);
}

Thanks,
Roger Martin
Tech Info Systems / Gallery Server Pro
www.techinfosystems.com / www.galleryserverpro.com
Jul 24 '07 #2
Hi Roger,

If the page only needs read-only access to the session state, you can use
EnableSessionSt ate="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 (wa****@online. 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.

Jul 25 '07 #3
Thanks. I ended up modifying the page to not use session state.

Roger
Jul 26 '07 #4

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

Similar topics

3
1404
by: Ivan P | last post by:
Hello! I have a index.php that on one click calls via AJAX a file.php. index.php looks like this: <html > <head> <script language="javascript" type="text/javascript" >
4
7472
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole new page that should replace an existing one. I.e when we issue an Ajax request we don't know what will be returned and analyze the response to act accordingly. Now, the way to replace the current document with a new one used to be easy and...
9
4854
by: dougloj | last post by:
Hi. I have an ASP.NET application written in C#. In part of my application, I want to use JavaScript OnClick event function to update a textbox with a string generated asynchronously on the server. I have pretty much figured out two ways to this. One way involves AJAX. The other way involves using cookies. I think AJAX is awesome, but what if the user's browser blocks ActiveX controls? On the other hand what if the browser blocks...
2
4549
by: germ | last post by:
doing a simple page webmethod call an a page via PageMethods works fine in ie7 & opera9 the same call on firefox ( and I assume netscape ) generates the following error : Error: " nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://hgha.gerzio.ca/ScriptResource.axd?d=3Ot8FdrYMQ58gwjNF6tbd8V5YtBKDtb8a6qI5cjRJWaZBQhYu2jjDRnc7N0IverhgY8x7LACpAIvqLPvNyERF0ui1Tz1p-s2eu0h41S_qMA1&t=633179517344763787 ::...
2
1996
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I am executing an AJAX page method that is a long running task. After starting the first method, I execute a second page method to retrieve the status of the task. It works fine in an empty web application, but when I paste the code into my main application (~10 projects, maybe 100 files) the behavior changes. What happens is the second page method will not begin executing until the first one finishes. In other words, the page methods...
2
1872
by: brice | last post by:
Hi, We are using static public methods decorated with 'WebMethod' as our AJAX implementation. We then use the client-side Sys.Net.PageMethod approach to invoke the page method. In the same application, this works fine with the built in web server, but fails with IIS. In IIS we get a 404 error. The application is in a subdirectory in IIS, in case that matters. All other ASP.NET functionality seems to be working fine under IIS and as...
1
5530
by: George Ter-Saakov | last post by:
People, I am going crazy already I have a page default.aspx where i am using Page Methods. Evetrything works fine. Now i want to create second page default2.aspx. in the same project/same folder. It gives me a JavaScript error PageMethods not defined. I copied (CNTRL+A, CNTRL+C, CNTRL+A, CNTRL+V) everything from default1.aspx into default2.aspx (no code behind).
8
2504
by: Rory Becker | last post by:
Hi All I have a need for an asp.net page to make a call to a server which it did not originate from when a button is clicked. A simple call to pass 2-3 params and return a result. I am happy to use an asynchronous model to do this. I control both servers. I have been looking at Ajax and PageMethods (Ajax.Net and Ajax Pro) and have even been looking at Calling a webservice from JS.
0
1564
Frinavale
by: Frinavale | last post by:
I have a peculiar problem... Background: I have a function that I don't want the user to execute more than once while they are waiting for it to process; therefore, I disable all of the controls on the page via some JavaScript before the request is sent. This function takes some time to execute because it has to communicate with hardware that is rather slow. This slowness combined with a little bit of lag sometimes results in a ...
0
8984
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.