[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Get hostname & display on screen...

Posted on 2006-07-13
2
Medium Priority
?
322 Views
Last Modified: 2012-06-21
I have some code which looks like this:
<%@ Register TagPrefix="SMWC" Namespace="SSWeb.Skins._controls" Assembly="SSWeb" %>
<%@ Page language="C#" Codebehind="Login.aspx.cs" AutoEventWireup="false" Inherits="SSWeb.Login" %>
<%@ Register TagPrefix="STWC" Namespace="SmarterTools.Web.Controls" Assembly="SmarterTools.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <META name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
            <META name="CODE_LANGUAGE" content="C#">
            <META name="vs_defaultClientScript" content="JavaScript">
            <META name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
            <LINK href="Skins/_default/Skin.css" type="text/css" rel="stylesheet">
      </HEAD>
      <BODY>
            <form id="Form1" method="post" runat="server">
                  <ASP:TEXTBOX id="txtSiteID" runat="server" wrap="False" maxlength="250" width="200" columns="25"></ASP:TEXTBOX>
                  <!-- more ... //-->
            </form>
      </BODY>
</HTML>

Basically, I want the txtSiteID to have the address hostname, so if the address bar was showing this:
http://www.domain.tld/site.aspx

I would like the txtSiteID to have a value of:
'www.domain.tld'

As you can see this may not be stright forwards as I have some CodeBehind and Inherits, and I'm not 100% sure how this works with the current form. I also do not have access to it's code.
0
Comment
Question by:aproxity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 17100860
try this:

Dim hostname as String=Environment.MachineName
0
 
LVL 4

Accepted Solution

by:
svy earned 1200 total points
ID: 17101123
use Request.Url.Host

MachineName can be different from actual HostName
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question