Click here to Skip to main content
15,911,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,

i am new to javascript. here i have tried the code for redirect to another page


div id =Locked
C#
$("#Locked").click(function () {
               window.location.href = "/Home/DisabledLockedUsers?userstatus=locked";
           });


situation is here i cannot use href tag so in that div click function i should redirect to anothere view

but also i cannot use window.location.href=""(because it will not support all browsers), instead of this, i need to use another way so please give me any idea about this pls

thanks in advance
velsamy
Posted

Might be this will help

$.ajax({
            type: 'Get',
            url: '@Url.Action("DisabledLockedUsers", "Home")',
            data: userstatus="locked"', 
            complete: function () {
                    }
                }
            });
        }
 
Share this answer
 
By using jQuery you can redirect
$(location).attr('href','http://yourPage.com/');

Hope this helps
 
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