Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > simple async post back example

Reply
Thread Tools

simple async post back example

 
 
Yankee Imperialist Dog
Guest
Posts: n/a
 
      06-05-2008
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!
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      06-05-2008
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!

 
Reply With Quote
 
 
 
 
Yankee Imperialist Dog
Guest
Posts: n/a
 
      06-05-2008
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="JavaScript">
<!--
function CheckTrepID(sender, args)
{
var TrpID = args.Value;
var alphs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var nums = '0123456789';
if (TrpID.length != 10)
{
args.IsValid = false;
return;
}

for (var i=0;i<3; i++)
if ( alphs.indexOf(TrpID.charAt(i)) == -1)
{
args.IsValid = false;
return;
}
for (var i=3;i<11; i++)
if ( nums.indexOf(TrpID.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!

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      06-05-2008
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="JavaScript">
> <!--
> function CheckTrepID(sender, args)
> {
> var TrpID = args.Value;
> var alphs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
> var nums = '0123456789';
> if (TrpID.length != 10)
> {
> args.IsValid = false;
> return;
> }
>
> for (var i=0;i<3; i++)
> if ( alphs.indexOf(TrpID.charAt(i)) == -1)
> {
> args.IsValid = false;
> return;
> }
> for (var i=3;i<11; i++)
> if ( nums.indexOf(TrpID.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!

 
Reply With Quote
 
Yankee Imperialist Dog
Guest
Posts: n/a
 
      06-05-2008
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="JavaScript">
> > <!--
> > function CheckTrepID(sender, args)
> > {
> > var TrpID = args.Value;
> > var alphs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
> > var nums = '0123456789';
> > if (TrpID.length != 10)
> > {
> > args.IsValid = false;
> > return;
> > }
> >
> > for (var i=0;i<3; i++)
> > if ( alphs.indexOf(TrpID.charAt(i)) == -1)
> > {
> > args.IsValid = false;
> > return;
> > }
> > for (var i=3;i<11; i++)
> > if ( nums.indexOf(TrpID.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!

 
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
Please Help - Async Web Service Example Bill44077 ASP .Net Web Services 0 06-05-2008 02:21 PM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
HTTP POST in C# CodeBehind and Async Encryption jacob.eiler@gmail.com ASP .Net 0 03-27-2006 04:41 AM
Async webservice call in async webpage (.Net 2.0) does not return Steven ASP .Net Web Services 0 11-30-2005 01:06 AM



Advertisments