Loading/splash screen / RegisterOnSubmitStatement

B

Brian Christensen

Hi,
Due to long periods during postbacks I'm experimenting on having a load
screen. Best practice for this I have been unable to find so I hope
someone here can point me in the right direction. I use the ASP 2.0
framework.

I want it to be a generel thing and hence I've played around with
ClientScript.RegisterOnSubmitStatement(...)
that injects js into the asp.framwork function

function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() ==
false) return false;
return true}

An example of using this:
function WebForm_OnSubmit() {
page.loadingMessage.show();
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() ==
false) return false;
return true;
}

This will cause clientside validation to be fired AFTER I show my
loading screen and hence the system "locks" if a clientside validator
is triggered

The next - to me - logical step would be to inject the following code
via RegisterOnSubmitStatement
if (typeof(ValidatorOnSubmit) == ""function"" && ValidatorOnSubmit() !=
false) { page.loadingMessage.show(); }

which produces

function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() !=
false) { page.loadingMessage.show(); };if (typeof(ValidatorOnSubmit) ==
"function" && ValidatorOnSubmit() == false) return false;
return true;
}

Homefree? Not yet as this will cause the clientside validator to fail
and just go straight to postback instead.

Any pointers are greatly appreciated.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top