473,324 Members | 2,248 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,324 software developers and data experts.

get full URL?

Is there something in the .Net libraries that will let me retrieve (or
get enough information to recreate) the full URL of a page in my
application? Sort of like the reverse Server.MapPath() that would at
least give me back the "http://www.mydomain.com" part of the url?
Thanks!

Matt
Nov 19 '05 #1
6 3656

"MattB" <so********@yahoo.com> wrote in message
news:3b*************@individual.net...
Is there something in the .Net libraries that will let me retrieve (or
get enough information to recreate) the full URL of a page in my
application? Sort of like the reverse Server.MapPath() that would at
least give me back the "http://www.mydomain.com" part of the url?
Thanks!

Matt

This may do the trick for you.

HttpContext.Current.Request.ServerVariables("SERVE R_NAME"))
Nov 19 '05 #2
Do you mean something like
Request.Url.AbsoluteUri

??

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"MattB" <so********@yahoo.com> wrote in message
news:3b*************@individual.net...
Is there something in the .Net libraries that will let me retrieve (or
get enough information to recreate) the full URL of a page in my
application? Sort of like the reverse Server.MapPath() that would at
least give me back the "http://www.mydomain.com" part of the url?
Thanks!

Matt

Nov 19 '05 #3
Use this :

----------------------------------
<%@ Page Language="VB" %>
<html>
<head>
<title>Path Info</title>
</head>
<script runat="server">
Public Sub Page_Load(Sender As System.Object, E As System.EventArgs)
If Not Request.Url Is Nothing Then
path.text = Request.Url.ToString()
End If
End Sub
</script>
<html>
<body>
<form id="Form1" runat="server">
<p>
<asp:Label id="path" runat="server" /><BR>
</form>
</body>
</html>
--------

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"MattB" <so********@yahoo.com> wrote in message
news:3b*************@individual.net...
Is there something in the .Net libraries that will let me retrieve (or get
enough information to recreate) the full URL of a page in my application?
Sort of like the reverse Server.MapPath() that would at least give me back
the "http://www.mydomain.com" part of the url?
Thanks!

Matt

Nov 19 '05 #4
That will do it, too, but Request.Url will do it
just as well, with a bit more economy of bytes.

I've sometimes wondered why 2 properties are needed,
if one of them will do the same job with less bytes being used.

One of those properties should be deprecated,
and I suspect it should be the one which takes
more characters to write.

;-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:Oc**************@TK2MSFTNGP12.phx.gbl...
Do you mean something like
Request.Url.AbsoluteUri

??

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"MattB" <so********@yahoo.com> wrote in message
news:3b*************@individual.net...
Is there something in the .Net libraries that will let me retrieve (or
get enough information to recreate) the full URL of a page in my
application? Sort of like the reverse Server.MapPath() that would at
least give me back the "http://www.mydomain.com" part of the url?
Thanks!

Matt


Nov 19 '05 #5
Hi Matt,

You already got your answer. Check out this page which gives you a rundown
of a number of common file paths that .NET publishes:

http://west-wind.com/weblog/posts/269.aspx

Aloha,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog

"MattB" <so********@yahoo.com> wrote in message
news:3b*************@individual.net...
Is there something in the .Net libraries that will let me retrieve (or get
enough information to recreate) the full URL of a page in my application?
Sort of like the reverse Server.MapPath() that would at least give me back
the "http://www.mydomain.com" part of the url?
Thanks!

Matt

Nov 19 '05 #6
Hello MattB,

You might try Request.Url.GetLeftPart(UriPartial.Authority) concatenated
with Request.ApplicationPath.

--
Matt Berther
http://www.mattberther.com
Is there something in the .Net libraries that will let me retrieve (or
get enough information to recreate) the full URL of a page in my
application? Sort of like the reverse Server.MapPath() that would at
least give me back the "http://www.mydomain.com" part of the url?
Thanks!

Matt

Nov 19 '05 #7

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

Similar topics

0
by: daking | last post by:
I'm trying to track down a Java performance issue, and believe it may be related to GC behavior. Quick background: j2se app server running Caucho Resin 2.1.12, on RHEL3 with Sun JDK 1.4.2_04,...
0
by: Tracey | last post by:
Hi there, I want to search Japanese characters with Full Text search function. I created a table (tbSearch) for Full-text search on SQL 2000, English Win2k Server. The table contains 4 fields,...
0
by: Denise | last post by:
Hi I have set up a full text index on one of my database tables and created a catalog. Then I started a full population on my catalog and got a message "Population of full text index started...
1
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's...
1
by: Jimmy Chen | last post by:
Recently I've done a db2 backup and restore/recovery, but the process for recovering the database was different than what I thought to be. here is what I did: DB2 is set in online mode -...
2
by: Lee | last post by:
I have two identical schema tables (one in a production library and another in a development library) and I need to be able to easily compare the data in them for errors and omissions. With...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
Hi there. I posted an earlier issue under the name "That assembly does not allow partially trusted callers" but have now identified what the issue is. As explained before I am working in...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
4
by: Brian D | last post by:
In MS SQL 2005 when you do a Full Backup does it also backup and truncate the transaction logs or do I need to back the transaction logs up separately? Thanks. Brian
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
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...
1
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.