i'm developing asp.net mvc 5 project . need redirect page when submit something. used javascript code :
return content("<script language='javascript' type='text/javascript'>alert('edited...');window.location.href = 'showcolor';</script>");
when edit in
http://localhost:56583/admin/editcolor/27
i want redirect page to
http://localhost:56583/admin/showcolor
with above code goes to
http://localhost:56583/admin/editcolor/showcolor
also used below code according redirecting action javascript didn't work :
return content("<script language='javascript' type='text/javascript'>alert('edited...');window.location.href = '@url.action('showcolor', 'admin')';</script>");
i have no idea how fix it.
i believe due relative paths. below should make relative domain.
window.location.href='/admin/showcolor'