Hide Copy Code
Code
a id="linkCart" href="cart.aspx">cart/a>but in 'cart.aspx' i am checking cookie value by
Hide Copy Code
Code
var userCookie = getCookie('loggedInUser');Code
function getCookie(name) {Code
var nameEQ = name + "=";Code
var ca = document.cookie.split(';');Code
for (var i = 0; i < ca.length; i++) {Code
var c = ca[i];Code
while (c.charAt(0) == ' ') c = c.substring(1, c.length);Code
if (c.indexOf(nameEQ) == 0)Code
return c.substring(nameEQ.length, c.length);Code
}Code
return null;Code
}Code
if (userCookie == null)Code
{Code
window.location.href = "loginpage.aspx";Code
}then if cookie value null then have to go 'login.aspx' page otherwise load this 'cart.aspx' page only
but when I click on 'cart' (anchor tag) then first displaying cart page then displaying loading.aspx page after condition is get true..
where as have to display directly 'login.aspx' page without display 'cart.aspx' page. so what to do?


Mukesh KumarRank #119 · 18.2K reputationPosted Oct 21, 2015, 4:49 AM EDT