Window.location无效 [英] Window.location not working

查看:153
本文介绍了Window.location无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我今天面临一个问题,即OnClientClick事件的按钮,javascript函数将用户重定向到一些不同的页面。

现在,它在我的同事的PC(IE和CHROME)中工作正常,但在我的电脑上在IE浏览器上不能正常工作,但谷歌浏览器工作正常。



请找代码:

Hi All,

I am facing a issue today i.e OnClientClick event of button, javascript function redirect user to some different page.
Now here, it working fine in my colleague's PC (both IE and CHROME) but not working same in my PC on IE browser but working fine with google chrome.

Please find Code :

function redirectToView() {
     redirectPage = "myorderpage.aspx?mode=0&mtf=False&orderno=" + orderNo;
     window.location = redirectPage;
     return false;
}




<asp:ImageButton ID="btnViewOrder" runat="server" ImageUrl="~/images/vieworderdetail.gif"
ToolTip="View Order Detail" Visible="True" 
OnClientClick="return redirectToView();">



有任何设置问题?

任何帮助都将不胜感激。


is there any setting issue?
Any help would be appreciated.

推荐答案

我认为您的JavaScript已在IE上禁用,您需要启用JavaScript在您的浏览器上。



点击此链接启用您的JavaScript。



http://support.microsoft.com/gp/howtoscript [ ^ ]



如果您的JavaScript已启用且仍然无效,那么您可以尝试



window.top.location =pageurl.aspx。



我用过这个文章:



http://www.c-sharpcorner.com/UploadFile/cd7c2e/如何自动刷新-gree-view-on-close-of-popup-menu / [ ^ ]
I think your JavaScript is disabled on IE, you need to enable your JavaScript on your Browser.

Follow this link to enable your JavaScript.

http://support.microsoft.com/gp/howtoscript[^]

If your JavaScript is enabled and still it is not working then you can try

window.top.location="pageurl.aspx".

I had used it in this article:

http://www.c-sharpcorner.com/UploadFile/cd7c2e/how-to-auto-refresh-grid-view-on-closing-of-popup-menu/[^]


你应该使用下面的代码用javascript进行redirct



window.location.href ='ur url'
you should use below code to redirct with javascript

window.location.href='ur url'


试着把下面可能是你的路径问题:



Try to put the below may be your path issue:

function redirectToView() {
     redirectPage = "/myorderpage.aspx?mode=0&mtf=False&orderno=" + orderNo;
     window.location = redirectPage;
     return false;
}


这篇关于Window.location无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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