I have problem with javascript code inside my controller. The below code working fine with all the browser(IE,Chrome and Safari) but not in Firefox? It prints the javascript code in the browser. Please help me anyone had the same issue. Thanks in advance.
public ActionResult LogOut()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.location.href = 'myurl'");
sb.Append("</script>");
return JavaScript(sb.ToString());
}
If any other way to do this please share with me.