Click here to Skip to main content
15,920,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 27-May-22 7:46am
v3

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/[^]
 
Share this answer
 
v2
Comments
Vikas_Shukla_89 5-Mar-14 5:37am    
Hi Anubhav, javascript settings were fine in the brower so i tried window.top.location, it worked this time but its not opening page within my master page.
you should use below code to redirct with javascript

window.location.href='ur url'
 
Share this answer
 
Try to put the below may be your path issue:

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900