Your
syntax
was indeed incorrect. You should do it like this:
OnClientClick="if('<%= bAlert%>'){alert('true');}else{LoadWorkflowMass();}return false;"
While that works, I'd still recommend you to place your logic within a
JavaScript
function so you can easily read and debug them. For example:
<head runat="server">
<title></title>
<script type="text/javascript">
function isValid() {
var result = '<%= bAlert%>';
if (result) {
alert('true');
}
else {
LoadWorkflowMass();
}
return false;
}
</script>
</head>
Then you simply call the
function
above like this:
OnClientClick="isValid();"