如何使用jquery将页面重定向到另一个aspx页面 [英] How to redirect a page to another aspx page using jquery

查看:74
本文介绍了如何使用jquery将页面重定向到另一个aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将页面重定向到此网址:Response.Redirect(StudentMedical.aspx?sid =+ StudentID);





这是c#代码



我想使用jQuery点击

  • 实现相同的代码
  • I wanna redirect page to this url : Response.Redirect("StudentMedical.aspx?sid=" + StudentID);


    This is c# code

    I wanna implement same code on click of

    • using jQuery
    • 推荐答案

      你可以使用window.location.replace或window.location.href或
      You can do this using window.location.replace or window.location.href or


      (location).attr。



      代码示例



      (location).attr.

      code examples

      window.location.replace("http://google.com")




      window.location.href ="http://google.com";





      location )。attr(' href',url);
      (location).attr('href', url);





      以下文章解释了上述方法的差异和用法

      http://www.coding-issues.com/2013/09/how-to-redirect-page- using-jquery.html [ ^ ]


      这篇关于如何使用jquery将页面重定向到另一个aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆