Try this in Response.Redirect
Response.Redirect("~/FCDReports/DailyReports/");
Or
Response.Redirect("FCDReports/DailyReports/");
質問
I deployed my ASP.NET MVC app to the server. My Site name is: http://server_name/Company_Reports
.
Everything works fine except when I redirect to some views.
For example when in .aspx
web form I redirect:
Response.Redirect("/FCDReports/DailyReports/");
In my website the site name Company_Reports
disappears and the Url becomes:
http://server_name/FCDReports/DailyReports/
and is not found because it should be:
http://server_name/Company_Reports/FCDReports/DailyReports/
How can I keep the site name Company_Reports
in the url?
I'd appreciate any help.
解決
Try this in Response.Redirect
Response.Redirect("~/FCDReports/DailyReports/");
Or
Response.Redirect("FCDReports/DailyReports/");