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/");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top