473,503 Members | 4,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Who is calling?

Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.
Jan 10 '06 #1
7 1457
Try REMOTE_HOST and see if that doesn't do it for you.

You also might want to look at the Request.Url property.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Arne" wrote:
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.

Jan 10 '06 #2
There are several values within the Request.URL object that you can use. Try
Request.URL.AbsolutePath or Request.URL.AbsoluteURL or Request.URL.LocalPath.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.

Jan 10 '06 #3
Request.Url is your friend. You'll find things like Request.Url.Authority
(which is what you want I think) and much more.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.

Jan 10 '06 #4
Phillip,
The request.URL is useful. When I run in a file-based Web project in Visual
Studio 2005 I get an extra folder name on the URL which is my project name.
This causes me problems. I wonder if switching to a web-base project would be
better.

Arne

"Phillip Williams" wrote:
There are several values within the Request.URL object that you can use. Try
Request.URL.AbsolutePath or Request.URL.AbsoluteURL or Request.URL.LocalPath.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.

Jan 10 '06 #5
Karl,
The request.URL is useful. When I run in a file-based Web project in Visual
Studio 2005 I get an extra folder name on the URL which is my project name.
This causes me problems. I wonder if switching to a web-base project would be
better.

Arne
"Karl Seguin [MVP]" wrote:
Request.Url is your friend. You'll find things like Request.Url.Authority
(which is what you want I think) and much more.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.


Jan 10 '06 #6
Hi Arne,

Try something like this:
if (Reuqest.Url.Port >0) //this is the case when vs2005 debugs a
file-based project
{
//this should strip off the project name and gets you only the path and
page name
string myUrl =
Request.Url.LocalPath.Replace(Request.Url.Segments[1],"");
}
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:
Phillip,
The request.URL is useful. When I run in a file-based Web project in Visual
Studio 2005 I get an extra folder name on the URL which is my project name.
This causes me problems. I wonder if switching to a web-base project would be
better.

Arne

"Phillip Williams" wrote:
There are several values within the Request.URL object that you can use. Try
Request.URL.AbsolutePath or Request.URL.AbsoluteURL or Request.URL.LocalPath.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:
Is there an easy way to get the URL that is used in a debugging session in
Visual Studo 2005?
I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
the port used.
The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
whole URL.

Jan 10 '06 #7
Correction:

The condition for checking is Port !=80

if (Reuqest.Url.Port!=80) {}
"Phillip Williams" wrote:
Hi Arne,

Try something like this:
if (Reuqest.Url.Port >0) //this is the case when vs2005 debugs a
file-based project
{
//this should strip off the project name and gets you only the path and
page name
string myUrl =
Request.Url.LocalPath.Replace(Request.Url.Segments[1],"");
}
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:
Phillip,
The request.URL is useful. When I run in a file-based Web project in Visual
Studio 2005 I get an extra folder name on the URL which is my project name.
This causes me problems. I wonder if switching to a web-base project would be
better.

Arne

"Phillip Williams" wrote:
There are several values within the Request.URL object that you can use. Try
Request.URL.AbsolutePath or Request.URL.AbsoluteURL or Request.URL.LocalPath.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Arne" wrote:

> Is there an easy way to get the URL that is used in a debugging session in
> Visual Studo 2005?
> I tried request.ServerVariable("REMOTE_PORT") but it returns blank and not
> the port used.
> The request.ServerVariable("SERVER_NAME") works OK, but I don't have the
> whole URL.

Jan 10 '06 #8

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

Similar topics

1
2301
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
8
2935
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
7
6581
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
5
3393
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
3
9050
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
2
3136
by: Geler | last post by:
A theoretical question: Sorry if its a beginner question. Here is a quote from the MSDN explaning the C/C++ calling convention.. It demonstrates that the calling function is responsible to clean...
47
4899
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
7
2663
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
10
3233
by: sulekhasweety | last post by:
Hi, the following is the definition for calling convention ,which I have seen in a text book, can anyone give a more detailed explanation in terms of ANSI - C "the requirements that a...
0
7067
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...
0
7316
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...
1
6975
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...
0
7449
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...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.