Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Equivalent in .NET

Status
Not open for further replies.

notrut

Programmer
Feb 6, 2002
87
CA
Hi,

I'm trying to find the equivanlent of the following javascript in .NET:

document.write ("ip= " + window.location.hostname + "<br>");
document.write ("uri= " + window.location.pathname + "<br>");

I've tried the following in .NET but they don't quite give me the same results:

Dim ip As String = "&dcssip=" & Request.UserHostName
Dim uri As String = "&dcsuri=" & Request.Path

IP: Looks like the JavaScript version gives me a server name and the .NET version gives me an IP address.

URI: Looks like the JavaScript version returns the pathname including the gateway while the .NET version does not.

I'd like to get the same info using .NET as JavaScript. Any ideas????

Any help would greatly be appreciated.
 
At the top of anyone of your ASP.NET pages add trace="true".
Here's an example:
Code:
<%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false" Inherits="PACS.BD._default" [b]trace="true"[/b]%>
Open the page on your server. This will list out all of the stuff that you can obtain from the Request object and what you need to call it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top