Dear @narasiman,
asper your code you are call the same function name two times. so the view button redirected to second function. please modify secondfunction name or use the validations for single function name.
<script type="text/javascript">
function openWindow(Date) {
window.open('Page1.aspx?Date=' + Date, 'open_window', ' width=450, height=300, left=0, top=0');
}
function openWindow1(Date) {
window.open('Page2.aspx?Date=' + Date, 'open_window', ' width=450, height=300, left=0, top=0');
}
</script>
or
<script type="text/javascript">
function openWindow(Date) {
if(Validation as per your requirement)
{
window.open('Page1.aspx?Date=' + Date, 'open_window', ' width=450, height=300, left=0, top=0');
}
else
{
window.open('Page2.aspx?Date=' + Date, 'open_window', ' width=450, height=300, left=0, top=0');
}
}
</script>