PC Review


Reply
Thread Tools Rate Thread

Asp.net, c#, custom validator, AJAX, client validate script, wait for server response

 
 
Jay Douglas
Guest
Posts: n/a
 
      27th Feb 2007
Hello all,

I'm in need of a custom validator that:

1). Runs server side code using ajax through a client validate function
2). Client validate function does not set args.IsValid until the server
responds
3). Any submit actions (via link button) do not take place until all client
validate functions run.

Pseudo client validate function (javascript):

I would like a method that works like:
function myClientValidate(sender, args)
{
// here's where i'd like the args to be sent
args.IsValid = WebForm_DoCallback(.....).;
}

Unfortunately, the CallBack fires a different event to deal with the
response, so I'm forced to do something like:

var isControlValid = false; // dynamically set on page load

function myClientValidate(sender, args)
{
return isControlValid;
}

function executeValidatorCallback()
{
WebForm_DoCallback(.....)
}

function updateCallbackResults(returnValue, context)
{
isControlValid = returnValue; // basically context just returns true or
false
}

To keep isControlValid I'm running executeValidatorCallback() on certain
page events and on a timed interval. This seems really messy to me.

So my question is:
How do I send a request to the server using javascript and wait for the
server responds before the javascript continues.

I'm at a loss, any advice would be great.

Thanks,
Jay


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
ASP.NET Validator is removing client onChange event handler for custom server control Lewis Holmes Microsoft ASP .NET 5 18th Mar 2009 07:14 AM
AJAX client script bug with validator Andrew Jocelyn Microsoft ASP .NET 4 11th Feb 2008 02:53 PM
custom validator and ajax Jeremy Microsoft ASP .NET 2 19th Apr 2007 06:20 AM
Asp.net, c#, custom validator, AJAX, client validate script, wait for server response Jay Douglas Microsoft ASP .NET 0 27th Feb 2007 01:07 AM
No client side script generated by custom validator Stephen Adam Microsoft ASP .NET 1 22nd Feb 2005 06:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.