チーズパン
チーズパン

Reputation: 2778

Some basic ambiguities on ASP.NET WebSite publishing

I managed to create a WebForms Project which I now published via Ftp-option my host provides. The first problem I encountered was that I had all my redirect calls pointing to a hard coded localhost-URL:

Response.Redirect("http://localhost:XYZAV/SearchResults.aspx);

My hosts server certainly can not redirect to that url. So I had to change all my redirect calls to url's the server knew. But this seems to be not the best option to deal with this problem. I mean I would have to chenge them every time I publish, plus for developement I would also have to change them back again.

I never had to use this option but I guess this is what the "Debug" and the "Release" options are there for, am I right? But I encounter two problems:

  1. I simply do not have the "Release" option in "Visual Studio 2013" for this project.
  2. Even if I had, what would be best practice to handle this issue?

I hope I made myself clear if not I will provide as much more information as possible.

Thanks in advance!

Upvotes: 0

Views: 28

Answers (1)

prog1011
prog1011

Reputation: 3495

Use This

It should -

Response.Redirect("SearchResults.aspx);

Upvotes: 1

Related Questions