I have a javascript function like
function CloseWindow() {
alert("I am firing"); // window.close();
}
I am trying to call it from code behind button click event like
Page.ClientScript.RegisterStartupScript([GetType](), "Javascript", "javascript:CloseWindow();", True)
The function is not firing alert message. If I call the same function from OnClientClick it is firing.
OnClientClick="javascript:();"
What might be the cause? If you want anymore clarification, please let me know.
by <script type="text/javascript" language="javascript">
function CloseWindow() {
alert("I am firing");
// window.close();
}
function chkLength(evt, len) {
var str = document.getElementById(evt.id);
if (str.value.length < len)
return true;
else
return false;
}
</script>