PC Review


Reply
Thread Tools Rate Thread

How to determine the base URL of current page

 
 
Anonieko
Guest
Posts: n/a
 
      2nd Jun 2007
private string GetSiteUrl()
{
string baseUrl = null;
HttpContext c = HttpContext.Current;
if (c != null)
{
string port = c.Request.ServerVariables["SERVER_PORT"];
if (port == null || port.Equals("80") ||
port.Equals("443"))
port = String.Empty;
else
port = ":" + port;

string protocol =
c.Request.ServerVariables["SERVER_PORT_SECURE"];

if (protocol == null || protocol.Equals("0"))
protocol = "http://";
else
protocol = "https://";

baseUrl = protocol +
c.Request.ServerVariables["SERVER_NAME"] + port +
c.Request.ApplicationPath;
}
return baseUrl;
}

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      2nd Jun 2007
"Anonieko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

<snip>

So what's the problem...?


--
http://www.markrae.net

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      2nd Jun 2007
Maybe we could all agree that posts which explain a solution to a problem,
whether requested or not, have "FAQ Solution:" in the subject ?

;-)




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
"Mark Rae" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> "Anonieko" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> <snip>
>
> So what's the problem...?
>
>
> --
> http://www.markrae.net



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      2nd Jun 2007
"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Maybe we could all agree that posts which explain a solution to a problem,
> whether requested or not, have "FAQ Solution:" in the subject ?
>
> ;-)


How many solutions to problems have you accumulated over the years...?

I've got hundreds of 'em... :-)


--
http://www.markrae.net

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      2nd Jun 2007
re:
!> How many solutions to problems have you accumulated over the years...?
!> I've got hundreds of 'em... :-)

Thousands...but I don't post them unprompted.

;-)

I proposed to a major publisher doing a book with them.
They said no...and 8 months later published a book with the same idea.

:-(





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
"Mark Rae" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> Maybe we could all agree that posts which explain a solution to a problem,
>> whether requested or not, have "FAQ Solution:" in the subject ?
>>
>> ;-)

>
> How many solutions to problems have you accumulated over the years...?
>
> I've got hundreds of 'em... :-)
>
>
> --
> http://www.markrae.net



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      2nd Jun 2007
"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> !> How many solutions to problems have you accumulated over the years...?
> !> I've got hundreds of 'em... :-)
>
> Thousands...but I don't post them unprompted.


Exactly.

> I proposed to a major publisher doing a book with them.
> They said no...and 8 months later published a book with the same idea.


Maybe an "ASP.NET Tips & Tricks" website would be better, although there are
a fair few of those already...


--
http://www.markrae.net

 
Reply With Quote
 
clintonG
Guest
Posts: n/a
 
      3rd Jun 2007
Why look the gift horse in the mouth?

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/


"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> !> How many solutions to problems have you accumulated over the years...?
>> !> I've got hundreds of 'em... :-)
>>
>> Thousands...but I don't post them unprompted.

>
> Exactly.
>
>> I proposed to a major publisher doing a book with them.
>> They said no...and 8 months later published a book with the same idea.

>
> Maybe an "ASP.NET Tips & Tricks" website would be better, although there
> are a fair few of those already...
>
>
> --
> http://www.markrae.net



 
Reply With Quote
 
rote
Guest
Posts: n/a
 
      4th Jun 2007
But if i remember i think Juan had a website of something related.
Can't reacll the website URL.
Can you forward it.
Patrick

"Mark Rae" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> !> How many solutions to problems have you accumulated over the years...?
>> !> I've got hundreds of 'em... :-)
>>
>> Thousands...but I don't post them unprompted.

>
> Exactly.
>
>> I proposed to a major publisher doing a book with them.
>> They said no...and 8 months later published a book with the same idea.

>
> Maybe an "ASP.NET Tips & Tricks" website would be better, although there
> are a fair few of those already...
>
>
> --
> http://www.markrae.net



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      4th Jun 2007
re:
!> But if i remember i think Juan had a website of something related.

I worked on http://www.aspnetfaq.com/ for a few months,
when the transition from ASP.NET Beta 2 to the release version was gpoing on.

The site owners were a bit impatient and wanted a major makeover,
but I was a lone developer...and a lot of details were changing very quickly.

The aspnetfaq site is, still, exactly as I left it a few months ago.

I *do* have a FAQ site at my server, but it's not a Q&A site.

It's a guidance site for ASP.NET beginners which, besides offering basic pointers
to where info about ASP.NET can be found, also offers tips on how to manage
interactions in this, and other, ASP.NET newsgroup(s).

That site is : http://asp.net.do/faq/ ...and is in my standard sig.

I'm still mulling over whether a Q & A FAQ site would be a good project.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
======================================
"rote" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> But if i remember i think Juan had a website of something related.
> Can't reacll the website URL.
> Can you forward it.
> Patrick
>
> "Mark Rae" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>
>>> !> How many solutions to problems have you accumulated over the years...?
>>> !> I've got hundreds of 'em... :-)
>>>
>>> Thousands...but I don't post them unprompted.

>>
>> Exactly.
>>
>>> I proposed to a major publisher doing a book with them.
>>> They said no...and 8 months later published a book with the same idea.

>>
>> Maybe an "ASP.NET Tips & Tricks" website would be better, although there are a fair few of those
>> already...
>>
>>
>> --
>> http://www.markrae.net

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine number of pages linked to current page lpp Microsoft Frontpage 4 25th May 2010 09:53 PM
dynamically determine the base href value Guoqi Zheng Microsoft ASP .NET 3 13th Jan 2005 05:33 PM
How to determine base interface??? J. Jones Microsoft C# .NET 14 7th Jan 2005 10:40 PM
Determine which assembly references are not from the base framework... Nathan Baulch Microsoft Dot NET Framework 3 27th Oct 2004 11:18 AM
How I can determine a base class of a procedure's incoming parameter? Dmitry V. Petkun Microsoft Excel Programming 1 12th Nov 2003 01:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:44 PM.