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........

6
  • 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. Commented Nov 5, 2013 at 11:47
  • @Paddy, Ok what you think about e.keycode == 17 && 18 && 82 Commented Nov 5, 2013 at 15:31
  • What do you think? Have you tried it? (hint, this probably isn't correct). Commented Nov 5, 2013 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" ?. Commented Nov 6, 2013 at 8: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..... Commented Nov 6, 2013 at 8:03

3 Answers 3

3

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

window.location.href = "OtherPage.aspx"
Sign up to request clarification or add additional context in comments.

1 Comment

hi, Paddy I am trying your way as above see my edit. but it wan't allow me to show new page...
0

Try this in your client side function:

window.location.assign("Page.aspx")

1 Comment

Did you try window.location.assign ?
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.