Domanda

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.

È stato utile?

Soluzione

Try this in Response.Redirect

Response.Redirect("~/FCDReports/DailyReports/");

Or

 Response.Redirect("FCDReports/DailyReports/");
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top