You're going to have to think about it slightly differently. The main
reason is you think all of this script interacts, when in fact, first the
ASP runs, then the client-side script runs. Let's look at it this way:
<%
sub showError(iErr)
response.write "<script>" & vbCrLf & _
"alert('" & replace(iErr,"'","\'") & "');" & _
"history.go(-1);" & vbCrLf & _
"</script>"
response.end
end sub
' play with making something true
' and somethingElse true
something = false
somethingElse = false
if something then
showError "this failed"
end if
if somethingElse then
showError "that failed"
end if
%>
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Ruskin" <> wrote in message
news:TC4bc.2418$d%...
>I have seen a couple of web sites that detail how to do this, but seem to
>be
> overlooking the obvious.... I have the following code and have tried
> variations to get it working;
>
>
> <!--#INCLUDE FILE="CommonFunctions.inc"-->
> <%
> 'following is vb script....
> if not MyFunction(check_field) then 'This function is in the
> include
> DisplayError("this failed")
> else
> ContinueProcess 'This sub routine is
> in the include
> end if
>
> sub DisplayError(iErr)
> %>
> <SCRIPT language="javascript">
> alert( <%= iErr %>);
> history.go(-1);
> </SCRIPT>
> <%
> end sub
>
> %>
>
> I want to pass different messages to the displayerror function, but just
> can't seem to make it work... Any ideas?
>
>