0

Is it possible in javascript to open new aspx page by using javascript?.

I mean if I wants to open a new page in asp.net than I will use "Server.Transfer" method to open new aspx page the same thing I am asking over here to open new aspx page by using javascript.

Is it possible?.

I am trying as per your suggestion as below:

<script type="text/javascript">
$(document).ready(function()
{
  function kpr(e)
  {
    if(e.which==17 && e.which==18 && e.which==82 || e.keyCode==17 && e.keyCode==18 &&   e.keyCode==82)
    {
      window.location.href="MemberInfo.aspx";
    }
  }
});
</script>

but it not allowed me to show new page as above........

  • I can't see a situation when e.which will equal 17 and 18 and 82 all at the same time. I think there is a problem with your logic. – Paddy Nov 05 '13 at 11:47
  • @Paddy, Ok what you think about e.keycode == 17 && 18 && 82 – user2955849 Nov 05 '13 at 15:31
  • What do you think? Have you tried it? (hint, this probably isn't correct). – Paddy Nov 05 '13 at 16:19
  • @Paddy, Agree, than can you suggest what is the correct way to display particular aspx page on press of keys like "Ctrl+Alt+R" ?. – user2955849 Nov 06 '13 at 08:01
  • @Paddy, yes I have tried it as you suggest. but it's not working can you guide me at right direction. If my logic is wrong than what is the use of keypress event at Asp.Net?. Is it works on only clicking or linking?. Is not works on Keypress event..... – user2955849 Nov 06 '13 at 08:03
  • You might want to have a look here: http://stackoverflow.com/questions/11678114/html-javascript-get-atl-ctrl-shift-key-press – Paddy Nov 06 '13 at 11:37

3 Answers3

3

Something like this (in the appropriate point in your script):

window.location.href = "OtherPage.aspx"
Paddy
  • 33,309
  • 15
  • 79
  • 114
0

Try this in your client side function:

window.location.assign("Page.aspx")
MusicLovingIndianGirl
  • 5,909
  • 9
  • 34
  • 65
0

Try using the debugging tools of your browser and set a checkpoint in your function to make sure that it actually gets to the window.location.href line.

Tobberoth
  • 9,327
  • 2
  • 19
  • 17