Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Hi
I am use html table onclick event

ASP.NET
<table cellpadding="0" id="LogoutImageButton"  runat="server"   önclick ="RedirectToLogin()"   cellspacing="0" border="0" >
                                        <tr>
                                        <td>
                                         <asp:Image ID="Image6" runat="server"  />
                                        </td>
                                        <td id="logoutMenu" meta:resourcekey="logoutMenu"  runat="server" valign="middle"  style="padding-left:3px;" >Logout</td>
                                        </tr>
                                     </table>



in javascript i will call webservice page

JavaScript
         function RedirectToLogin() {
              var UserName = document.getElementById("MasterUser").value;
alert(UserName);
                SuperFastWS.FnLogout(decodeURI(UserName));
               }


SuperFastWS is webservice and Fnlogout is function in webservice.The above one work correctly in IE and Chrome,but in FireFox it not work.if i place breakpoint in Logout function,in IE and Chrome only trigger that function,mozilla not trigger that function.For testing purpose i will use aleart,in mozilla it show alert msg but function not trigger.Why in Mozilla only not work ?


Pls reply asap
Regards

Aravind
Posted
Updated 27-Jun-14 1:19am
v2
Comments
SRS(The Coder) 27-Jun-14 8:53am    
For this i'll suggest :-
i) open the developers tool of firefox by pressing F12 or install FireBug.
ii) Open the 'Console' tab and click on the table.
ii) It will show the exact error if any so that you can get ahint to solve it easily.
Aravindba 27-Jun-14 10:09am    
i will try,i will use in masterpage,if i press f12 in mozilla or chrome ,in console tab it not show masterpage aspx codes(html code),other than master page it show ,and also webservice page also not view in console tab.

Hi Finally i got solution form this link

http://www.tutorialspoint.com/javascript/javascript_page_redirect.htm[^]


just i add setTimeout call redirect to other page after calling webservice method,so it have some time to tigger

function RedirectToLogin() {
var UserName = document.getElementById("MasterUser").value;
SuperFastWS.FnLogout(decodeURI(UserName));
setTimeout('Redirect()', 5);
}

function Redirect() {

window.location = "logout.aspx";
}

So above setTimeout i will get some 5 micro milli secs to wait and call redirect to other page.
 
Share this answer
 
try this too..

setTimeout('loadNewDoc()', 5000)

C#
function loadNewDoc(){
    window.location="http://www.w3.org";
}


Full Source...Javascript Redirect

Clint
 
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