473,320 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to hide "localhost"

Hi,

in a Page_Load I use:
Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")

Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx" in
the adress-field. Is the name "localhost" shown in my ieplorer only - if not
how can I rename it (or shouldn't I).

Greg.

Nov 18 '05 #1
4 3562
Response.Redirect("/WebApplication3/frmDefault.aspx")

"Greg Cyrus" <no****@muelltonne.de> wrote in message
news:cj*************@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")

Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx" in the adress-field. Is the name "localhost" shown in my ieplorer only - if not how can I rename it (or shouldn't I).

Greg.

Nov 18 '05 #2
> Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")
wont work, if you try to access your site from some other machine. You have
to use one of the HttpRequest properties (such as Path, Or Url, Or some of
the ServerVariables item) to construct your HTTP path.

Something like:
Response.Redirect( Request.Url.Scheme + "://" + Request.Url.Host +
Requestr.ApplicationPath + "/frmDefault.aspx");
--
Girish Bharadwaj
http://msmvps.com/gbvb
"Greg Cyrus" <no****@muelltonne.de> wrote in message
news:cj*************@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")

Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx" in the adress-field. Is the name "localhost" shown in my ieplorer only - if not how can I rename it (or shouldn't I).

Greg.

Nov 18 '05 #3
If you are doing the Reponse.Redirect FROM WebApplication3 virtual directory
then just do:

Response.Redirect("frmDefault.aspx")

or

Response.Redirect("~/frmDefault.aspx") if you were calling this from within
a subdirectory.

"~" resolves to http://localhost/WebApplication3/ (in your case)

You should never hardcode server names, etc.

Prefixing your web pages with "frm" seems kinda strange to me...

Greg

"Greg Cyrus" <no****@muelltonne.de> wrote in message
news:cj*************@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")

Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx"
in the adress-field. Is the name "localhost" shown in my ieplorer only -
if not how can I rename it (or shouldn't I).

Greg.

Nov 18 '05 #4
"localhost" is the default Domain name of the local machine. It maps to IP
Address "127.0.0.1" (local loopback). Therefore, on any machine which uses
"localhost" in a URL, a redirect will always go to their local web server
(if any) or throw an exception. For this reason, you should NEVER use the
string "localhost" in your app, unless you plan to run it only locally.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Greg Cyrus" <no****@muelltonne.de> wrote in message
news:cj*************@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx")

Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx" in the adress-field. Is the name "localhost" shown in my ieplorer only - if not how can I rename it (or shouldn't I).

Greg.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: aa | last post by:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini in php.ini I have: SMTP = localhost SMTP_PORT = 25...
5
by: Chris | last post by:
What is going on here... I have my site running locally on my machine, and when I don't have an internet connection (like when Im on the train) I get this error when I try to open an asp.net...
1
by: Timo | last post by:
I'm trying to use a LinkButton with both an HREF and an OnClick to defeat the popup blocker because we have a disproportionately high number of users who won't know they have popups blocked or...
3
by: Robin Tucker | last post by:
Should I consider this to work in other locales? If theServer.Name <> "(local)" and theServer.Name <> "(localhost)" Then ' Can only use local machine in this version..... End If
0
by: Durai | last post by:
Hello All, I built postgresql on HPUX IPF(11.22) platform. It works fine. But I have warning message "could not resolve "localhost": host nor service provided, or not known" when I start the...
3
by: Lee Roth | last post by:
I am testing a web app that links to user defined URLs. I want the link to be the exact text the user provided but I can't seem to get rid of the "http://localhost" prefix in the link. Note that I...
5
by: KenLee | last post by:
help: how can I change from "//localhost:numbers/" to just "//localhost/"? I can see the web pages using "//localhost:numbers/" instead of ""//localhost/". I use asp.net 2.o. and windows 2000....
12
by: Jonathan Wood | last post by:
Greetings, I wonder if anyone can help me with this. I have an XP laptop, and a Vista desktop computer. I use the laptop to run software remotely on the desktop using the Remote Desktop...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.