473,395 Members | 1,440 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,395 software developers and data experts.

Invalid URI: The hostname could not be parsed

Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers

Nov 19 '05 #1
7 23537
Do you have the time of the error?

Have you checked your weblogs to see if you can see any invalid requests
coming through at the same time?

That may be the place to begin...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers

Nov 19 '05 #2
the browser/proxy/firewall is free to put anything it wants in the
UrlReferrer header, so Request.UrlReferrer will not necessarily return a
valid url, thus the thrown execption.

-- bruce (sqlwork.com)
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers

Nov 19 '05 #3
That is fine but I have the problem when I am checking Request.UrlReferrer
against null.
Instead of being null, it throws an exception.

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers
"Bruce Barker" <br******************@safeco.com> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
the browser/proxy/firewall is free to put anything it wants in the
UrlReferrer header, so Request.UrlReferrer will not necessarily return a
valid url, thus the thrown execption.

-- bruce (sqlwork.com)
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers


Nov 19 '05 #4
Actually I didn't try this one. I will have a look to that too.
However the interesting thing is it fails at Microsoft's code part not mine.

My code is as follows:
' URL Referrer

Dim URLReferrer As String = ""

If Not Request.UrlReferrer Is Nothing Then

URLReferrer = Request.UrlReferrer.ToString()

End If

Thanks
--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Do you have the time of the error?

Have you checked your weblogs to see if you can see any invalid requests
coming through at the same time?

That may be the place to begin...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers


Nov 19 '05 #5
1.
A value of type System.Uri cannot be converted to String.

2.
Have you tried using
URLReferrer = Request.ServerVariables("http_referer")

?
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/
======================================
"SevDer" <se****@newsgroup.nospam> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
That is fine but I have the problem when I am checking Request.UrlReferrer against null.
Instead of being null, it throws an exception.

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers
"Bruce Barker" <br******************@safeco.com> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
the browser/proxy/firewall is free to put anything it wants in the UrlReferrer header,
so Request.UrlReferrer will not necessarily return a valid url, thus the thrown
execption.

-- bruce (sqlwork.com)
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers




Nov 19 '05 #6
I caught the referrer.

These guys are coming as
http://www%2echina%2dairline%2ecom/s...FpcmxpbmUuY29t

But their browsers are fine. They are all MSIE 6.0 browsers.
I didn't get why this is happening!

Do you have any idea? Can it be like a software that uses some sites to get
links or so?
So that it does not send the url properly?

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers
"SevDer" <se****@newsgroup.nospam> wrote in message
news:u4**************@tk2msftngp13.phx.gbl...
Actually I didn't try this one. I will have a look to that too.
However the interesting thing is it fails at Microsoft's code part not
mine.

My code is as follows:
' URL Referrer

Dim URLReferrer As String = ""

If Not Request.UrlReferrer Is Nothing Then

URLReferrer = Request.UrlReferrer.ToString()

End If

Thanks
--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
Do you have the time of the error?

Have you checked your weblogs to see if you can see any invalid requests
coming through at the same time?

That may be the place to begin...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"SevDer" <se****@newsgroup.nospam> wrote in message
news:ez*************@TK2MSFTNGP12.phx.gbl...
Do you have any idea why I am getting the following error?

Invalid URI: The hostname could not be parsed.
Inner stack trace
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at System.Web.HttpRequest.get_UrlReferrer()
at DotNetNuke.CDefault.ManageRequest()
at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain()
Currently we experience this around 100 times a day.

Thanks for the information in advance

--

SevDer
http://www.sevder.com
A new .NET Source For .NET Developers



Nov 19 '05 #7
Hi SevDer,

So the problem is just caused by the following uri you mentioned:
===========
http://www%2echina%2dairline%2ecom/s...rlines&Site=d3
d3LmNoaW5hLWFpcmxpbmUuY29t
==========

You can get the problem also through the below code:

string str =
"http://www%2echina%2dairline%2ecom/search.asp?Keyword=China+Airlines&Site=d
3d3LmNoaW5hLWFpcmxpbmUuY29t";

Uri uri = new Uri(str);

And as the exception message mentioned, the proboem is the Host name, it
seems that the
"www%2echina%2dairline%2ecom" is incorrectly encoded while the correct one
should be

www.china-airline.com (is not urlencoded).

Also, from the

http://www%2echina%2dairline%2ecom/s...rlines&Site=d3
d3LmNoaW5hLWFpcmxpbmUuY29t

we can find that the request is sent by the search page on the
china-airline site, so the urlreferer is possibly set by code
programmatically.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
| Reply-To: "SevDer" <se******@sevder.com>
| From: "SevDer" <se****@newsgroup.nospam>
| References: <ez*************@TK2MSFTNGP12.phx.gbl>
<#U**************@TK2MSFTNGP14.phx.gbl>
<u4**************@tk2msftngp13.phx.gbl>
| Subject: Re: Invalid URI: The hostname could not be parsed
| Date: Thu, 6 Oct 2005 17:21:39 -0400
| Lines: 102
| Organization: http://www.sevder.com
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| Message-ID: <eG**************@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:129604
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I caught the referrer.
|
| These guys are coming as
|
http://www%2echina%2dairline%2ecom/s...rlines&Site=d3
d3LmNoaW5hLWFpcmxpbmUuY29t
|
| But their browsers are fine. They are all MSIE 6.0 browsers.
| I didn't get why this is happening!
|
| Do you have any idea? Can it be like a software that uses some sites to
get
| links or so?
| So that it does not send the url properly?
|
| --
|
| SevDer
| http://www.sevder.com
| A new .NET Source For .NET Developers
|
|
| "SevDer" <se****@newsgroup.nospam> wrote in message
| news:u4**************@tk2msftngp13.phx.gbl...
| > Actually I didn't try this one. I will have a look to that too.
| > However the interesting thing is it fails at Microsoft's code part not
| > mine.
| >
| > My code is as follows:
| > ' URL Referrer
| >
| > Dim URLReferrer As String = ""
| >
| > If Not Request.UrlReferrer Is Nothing Then
| >
| > URLReferrer = Request.UrlReferrer.ToString()
| >
| > End If
| >
| >
| >
| > Thanks
| >
| >
| > --
| >
| > SevDer
| > http://www.sevder.com
| > A new .NET Source For .NET Developers
| >
| >
| > "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
| > message news:%2****************@TK2MSFTNGP14.phx.gbl...
| >> Do you have the time of the error?
| >>
| >> Have you checked your weblogs to see if you can see any invalid
requests
| >> coming through at the same time?
| >>
| >> That may be the place to begin...
| >>
| >> --
| >> Sincerely,
| >>
| >> S. Justin Gengo, MCP
| >> Web Developer / Programmer
| >>
| >> www.aboutfortunate.com
| >>
| >> "Out of chaos comes order."
| >> Nietzsche
| >> "SevDer" <se****@newsgroup.nospam> wrote in message
| >> news:ez*************@TK2MSFTNGP12.phx.gbl...
| >>> Do you have any idea why I am getting the following error?
| >>>
| >>> Invalid URI: The hostname could not be parsed.
| >>> Inner stack trace
| >>> at System.Uri.Parse()
| >>> at System.Uri..ctor(String uriString, Boolean dontEscape)
| >>> at System.Uri..ctor(String uriString)
| >>> at System.Web.HttpRequest.get_UrlReferrer()
| >>> at DotNetNuke.CDefault.ManageRequest()
| >>> at DotNetNuke.CDefault.Page_Init(Object sender, EventArgs e)
| >>> at System.Web.UI.Control.OnInit(EventArgs e)
| >>> at System.Web.UI.Control.InitRecursive(Control namingContainer)
| >>> at System.Web.UI.Page.ProcessRequestMain()
| >>>
| >>>
| >>> Currently we experience this around 100 times a day.
| >>>
| >>> Thanks for the information in advance
| >>>
| >>> --
| >>>
| >>> SevDer
| >>> http://www.sevder.com
| >>> A new .NET Source For .NET Developers
| >>>
| >>>
| >>>
| >>
| >>
| >
| >
|
|
|

Nov 19 '05 #8

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

Similar topics

7
by: Sunny | last post by:
Hi all, I have found a possible bug in the Uri class constructor. When I make something like this: test = new Uri(@"http://www.test.com/dir1/page1.html"); test2 = new Uri(test,...
4
by: Chris McIlvoy | last post by:
Here is my line of code Page.Response.Redirect("http://about:blank") Here is the error I am gettin Invalid URI: The hostname could not be parsed. Could someone please explain?
3
by: Hans | last post by:
Hello, I am trying to create a Webrequest. The used Uri is something like "http://username@domain.com:password@www.shfgshfge.com". Note that the username contains an "@"-character. I tried two...
19
by: Alan J. Flavell | last post by:
The story so far: on somewhat unrelated newsgroup, my attention fell upon the URL: http://www.speedtouchdsl.com/prod706.htm which contains a link to the purported URL:...
1
by: Patrick.O.Ige | last post by:
Hi guys, I just moved a project from my pc to a server production (to an ISP). on my pc it all works fine with no errors. After fireing up the first page "default.aspx" i get the error...
4
by: John Smith | last post by:
Hello, I'm not sure if these are the appropriate forums for my question since it is closer to about Visual Studio 2005 than it is about .NET framework. So please pardon me and direct me to a...
0
by: dmgonzo | last post by:
I get the following when the site has been idle for several hours and i press a link. I have my application running .net 2.0 and connect to a web service that is 1.1. Any help is appreciated! ...
0
by: anacrisan | last post by:
I have a strange problem with a WebRequest. It used to work just fine, but now I get an exception (Invalid URI: The hostname could not be parsed.) every time I try to get the response from that...
0
by: =?Utf-8?B?bmZvdW50YXM=?= | last post by:
I started with having xml schema files compiled as resources in a wpf windows application. I was able to read the xml schema resource successfully using the following pack uri: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.