jquery - ASP.NET and Javascript not working in Firefox issue -


i have problem javascript code inside controller. below code working fine browser(ie,chrome , safari) not in firefox? prints javascript code in browser. please me had same issue. 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 other way please share me.

try returning content instead of javascript:

return content(sb.tostring()); 

but if need redirect users, it's better use redirect:

return redirect("myurl"); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -