473,659 Members | 3,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple async post back example

I need to do a simple asych post back to validate that an id is unique. I do
not want to post back the entire page for this, but i want to make this part
of the clientside validators.

1. i already have a custom validator that checks for a correctly formatted
id and the javascript works w/o problem.

Any help would be appreciated.
--
Share The Knowledge. I need all the help I can get and so do you!
Jun 27 '08 #1
4 2192
async postback is incompatiable with validators. validatiors are called to
cancel a postback, they can not wait around for the async return.

you could use an update panel, but this is really a full postback and page
process.

-- bruce (sqlwork.com)
"Yankee Imperialist Dog" wrote:
I need to do a simple asych post back to validate that an id is unique. I do
not want to post back the entire page for this, but i want to make this part
of the clientside validators.

1. i already have a custom validator that checks for a correctly formatted
id and the javascript works w/o problem.

Any help would be appreciated.
--
Share The Knowledge. I need all the help I can get and so do you!
Jun 27 '08 #2
thanks for replying,
(I think my description was off.)

I gues that's the point i want the validator to cancel the post back.
i have a customvalidator that uses the following script
<script language="JavaS cript">
<!--
function CheckTrepID(sen der, args)
{
var TrpID = args.Value;
var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
var nums = '0123456789';
if (TrpID.length != 10)
{
args.IsValid = false;
return;
}

for (var i=0;i<3; i++)
if ( alphs.indexOf(T rpID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
for (var i=3;i<11; i++)
if ( nums.indexOf(Tr pID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
args.IsValid = true;
}
// -->
</script>

What i'd like to do is if the script see's that the new Trpid is correctly
formatted. to call a webservice with that Trpid and have the web service
return a bool saying if it exists. There has to be a way to do this. I just
can't find a simple example of how to do this.

Thanks
KES
--
Share The Knowledge. I need all the help I can get and so do you!
"bruce barker" wrote:
async postback is incompatiable with validators. validatiors are called to
cancel a postback, they can not wait around for the async return.

you could use an update panel, but this is really a full postback and page
process.

-- bruce (sqlwork.com)
"Yankee Imperialist Dog" wrote:
I need to do a simple asych post back to validate that an id is unique. I do
not want to post back the entire page for this, but i want to make this part
of the clientside validators.

1. i already have a custom validator that checks for a correctly formatted
id and the javascript works w/o problem.

Any help would be appreciated.
--
Share The Knowledge. I need all the help I can get and so do you!
Jun 27 '08 #3
you would need to do a sync webservice call not an async one (or async
callback). see the ms ajax toolkit or the jquery toolkit.

-- bruce (sqlwork.com)
"Yankee Imperialist Dog" wrote:
thanks for replying,
(I think my description was off.)

I gues that's the point i want the validator to cancel the post back.
i have a customvalidator that uses the following script
<script language="JavaS cript">
<!--
function CheckTrepID(sen der, args)
{
var TrpID = args.Value;
var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
var nums = '0123456789';
if (TrpID.length != 10)
{
args.IsValid = false;
return;
}

for (var i=0;i<3; i++)
if ( alphs.indexOf(T rpID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
for (var i=3;i<11; i++)
if ( nums.indexOf(Tr pID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
args.IsValid = true;
}
// -->
</script>

What i'd like to do is if the script see's that the new Trpid is correctly
formatted. to call a webservice with that Trpid and have the web service
return a bool saying if it exists. There has to be a way to do this. I just
can't find a simple example of how to do this.

Thanks
KES
--
Share The Knowledge. I need all the help I can get and so do you!
"bruce barker" wrote:
async postback is incompatiable with validators. validatiors are called to
cancel a postback, they can not wait around for the async return.

you could use an update panel, but this is really a full postback and page
process.

-- bruce (sqlwork.com)
"Yankee Imperialist Dog" wrote:
I need to do a simple asych post back to validate that an id is unique. I do
not want to post back the entire page for this, but i want to make this part
of the clientside validators.
>
1. i already have a custom validator that checks for a correctly formatted
id and the javascript works w/o problem.
>
Any help would be appreciated.
--
Share The Knowledge. I need all the help I can get and so do you!
Jun 27 '08 #4
ok, thanks
--
Share The Knowledge. I need all the help I can get and so do you!
"bruce barker" wrote:
you would need to do a sync webservice call not an async one (or async
callback). see the ms ajax toolkit or the jquery toolkit.

-- bruce (sqlwork.com)
"Yankee Imperialist Dog" wrote:
thanks for replying,
(I think my description was off.)

I gues that's the point i want the validator to cancel the post back.
i have a customvalidator that uses the following script
<script language="JavaS cript">
<!--
function CheckTrepID(sen der, args)
{
var TrpID = args.Value;
var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
var nums = '0123456789';
if (TrpID.length != 10)
{
args.IsValid = false;
return;
}

for (var i=0;i<3; i++)
if ( alphs.indexOf(T rpID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
for (var i=3;i<11; i++)
if ( nums.indexOf(Tr pID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
args.IsValid = true;
}
// -->
</script>

What i'd like to do is if the script see's that the new Trpid is correctly
formatted. to call a webservice with that Trpid and have the web service
return a bool saying if it exists. There has to be a way to do this. I just
can't find a simple example of how to do this.

Thanks
KES
--
Share The Knowledge. I need all the help I can get and so do you!
"bruce barker" wrote:
async postback is incompatiable with validators. validatiors are called to
cancel a postback, they can not wait around for the async return.
>
you could use an update panel, but this is really a full postback and page
process.
>
-- bruce (sqlwork.com)
>
>
"Yankee Imperialist Dog" wrote:
>
I need to do a simple asych post back to validate that an id is unique. I do
not want to post back the entire page for this, but i want to make this part
of the clientside validators.

1. i already have a custom validator that checks for a correctly formatted
id and the javascript works w/o problem.

Any help would be appreciated.
--
Share The Knowledge. I need all the help I can get and so do you!
Jun 27 '08 #5

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

Similar topics

1
7133
by: scott ocamb | last post by:
hello I have implemented a solution using async methods. There is one async method that can be invoked multiple times, ie there are multiple async "threads" running at a time. When these threads are complete, the call the Callback method. Each "thread" calls the same callback method. What thread does this callback method exist on? My testing indicates the
6
10449
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing anything. I have searched through the Internet and seems like the reason it hangs the browser it's because XMLHTTP limits you to two concurrent HTTP connections to each remote host; so if more than 2 concurrent connections strike the script...
0
1260
by: JDK | last post by:
This may be entirely the wrong forum for this message, but I wanted to give it a try. I am creating an ASPX page, with C# code behind, and am calling on a C# helper class, which in turn is wrapping a lot of functionality from a vendor's SDK. The SDK (which I have no source for, or visibility into) is actually Java-based; they wrote a COM (or COM+) wrapper for it long ago, and more recently created a .NET wrapper for *that*. I have a...
10
2949
by: Shawn Meyer | last post by:
Hello - I am trying to write a class that has an async BeginX and EndX, plus the regular X syncronous method. Delegates seemed like the way to go, however, I still am having problems getting exactly what I want. Here are my goals 1. I would like the IAsyncResult that is returned by the Begin function to be able to be waited on or polled to check for completion. 2. The Begin function would take a callback, and the async process would
7
2851
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets send the messagetype via async NetworkStream ns = client.GetStream(); //assume client globally accessible
7
5068
by: =?Utf-8?B?Q2FybG8gRm9saW5p?= | last post by:
Hi, I implemented asynchronous calls to a web resource (using HttpWebRequest) from asp.net 2.0. The request it's made asyncronously (I see that beginGetResponse returns immediately). The number of worker thread and completionPortThreads are over 300. Making 200 calls I see that 100 are queued. There's a counter telling how much async calls are handled? How can I raise the number of request handled?
10
4497
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under consideration here is that it is supplied to the AsyncOperationManager.CreateOperation(userSuppliedState) method... with userSuppliedState being, more or less, a taskId. In this case, the userSuppliedState {really taskId} is of the object type,...
13
1765
by: Alexander Gnauck | last post by:
Hello, while using async sockets I ran into a strange problem which occurs only on some machines. I wrote a small demo application which can be used to reproduce the problem. You can download it from here: http://alex.ag-software.de/SocketTest.zip If you press the "Connect in new Thread" button from the test application you may be able to cause the System.IO.IOException: Unable to write data to the transport connection. While the...
4
3669
by: prit | last post by:
As we know ajax resides between server and client and helps the page's partial rendering...so no need to render all the page controls from scratch....so when we know that some controls requires post back data..we put those control in ajax "update panel" tags...and rest of the non postback enabled controls outside updte panel.... Now we have 6 controls in a web form...2 of them dont need async process..and 4 of them need async process...so we...
0
8428
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
8851
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...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
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...
0
7359
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2754
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
2
1739
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.