473,804 Members | 3,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to hide "localhost"

Hi,

in a Page_Load I use:
Response.Redire ct("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 3587
Response.Redire ct("/WebApplication3/frmDefault.aspx ")

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

in a Page_Load I use:
Response.Redire ct("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.Redire ct("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.Redire ct( Request.Url.Sch eme + "://" + Request.Url.Hos t +
Requestr.Applic ationPath + "/frmDefault.aspx ");
--
Girish Bharadwaj
http://msmvps.com/gbvb
"Greg Cyrus" <no****@muellto nne.de> wrote in message
news:cj******** *****@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redire ct("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.Redirec t FROM WebApplication3 virtual directory
then just do:

Response.Redire ct("frmDefault. aspx")

or

Response.Redire ct("~/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****@muellto nne.de> wrote in message
news:cj******** *****@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redire ct("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****@muellto nne.de> wrote in message
news:cj******** *****@news.t-online.com...
Hi,

in a Page_Load I use:
Response.Redire ct("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
73774
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 SENDMAIL_FROM = NULL SENDMAIL_PATH = "H:\WINNT\system32\" (this is where sendmail.dll is sitting. H is the drive with w2k)
5
2125
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 project: "The web server reported the following error when attempting to create or open the web project located at the following URL: 'http://localhost'. The server name or address could not be resolved."
1
2634
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 even know what a popup is. Our site opens pages from our affiliates in a popup window. Why do I get an error saying page http://localhost/www.msn.com cannot be found? How is 'localhost' entering into the picture? I assume there's a conflict...
3
1603
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
1436
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 postmaster. I have given entries in pg_hba.conf file to access also. $ ./postmaster -D /var/opt/iexpress/postgresql & 2410 $ LOG: could not resolve "localhost": host nor service provided, or not known LOG: database system was shut down...
3
5107
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 am user defined email addresses for "mailto:" links and the same problem occurs. Is this something that will be removed when the site is published? All help is appreciated, Lee
5
2132
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. how can i set up from "//localhost:numbers/" to just "//localhost/" so that other people could see the page not the error message. .....
12
2382
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 Connection software. Everything is working just fine. However, whenever I run an ASP.NET Website project in Visual Studio, the browser pops up a "Connect to localhost"
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.