Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP.NET Code behind Javascript Problem

m.ahrens
Guest
 
Posts: n/a
#1: Jul 21 '05
Hi all

my java script looks like:

<script language="javascript">
function showProgress()
{
window.setTimeout('sleep()',2000);
}
function sleep()
{
normal.style.display = "none";
inProgress.style.display = "block";
}
</script>

my code behind looks like:

btn.Text = resourceManager.GetString("btnErstellen");
btn.Attributes.Add("onclick","showProgress();");

as you can see i connect my jscript to the clickevent of the button...i only
have one problem...if for example a requiredfieldvalidator shows an error.
The button is then not executed (the code behind part is not executed)...but
the jscript code is executed and that is not what i want...

how can i tell javascript not to execute if an error is on the page?

has anyone a solution for the problem?

thanks for your help!
m.ahrens

Closed Thread