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

Error reading Web Page

TCB
I am getting this error while tryin to read the contents of a Web page so I
can send them in an email:
"Too many automatic redirections were attempted."

This is the code I am using

Private Function readHtmlPage(ByVal url As String) As [String]
Dim result As [String]
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim sr As New StreamReader(objResponse.GetResponseStream())
Try
result = sr.ReadToEnd()
' Close and clean up the StreamReader
sr.Close()
Finally
sr.Dispose()
End Try
Return result
End Function

I cannot find any documentation on how to fix this problem.

THANKS!
Mar 9 '06 #1
3 2605
it looks like the page keeps redirecting to itself...I think it's a problem
with the URL you are requesting. Maybe it's expecting certain header
parameters...

Karl

--
http://www.openmymind.net/

"TCB" <tc******@hotmail.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
I am getting this error while tryin to read the contents of a Web page so I
can send them in an email:
"Too many automatic redirections were attempted."

This is the code I am using

Private Function readHtmlPage(ByVal url As String) As [String]
Dim result As [String]
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim sr As New StreamReader(objResponse.GetResponseStream())
Try
result = sr.ReadToEnd()
' Close and clean up the StreamReader
sr.Close()
Finally
sr.Dispose()
End Try
Return result
End Function

I cannot find any documentation on how to fix this problem.

THANKS!

Mar 9 '06 #2
TCB
Thank you, got that part working. Now the page i am trying to send contains
some thumbnails generated by another .aspx webform so the image source for
those images is something like:

src="http://www.mydomain.com/MidThumbnail.aspx?AdId=40&amp;Type=1&amp;HorSize=1 60&amp;VerSize=120&amp;ImageNo=1

But this images do not load in outlook when I open the mail message

THANKS
"TCB" <tc******@hotmail.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
I am getting this error while tryin to read the contents of a Web page so I
can send them in an email:
"Too many automatic redirections were attempted."

This is the code I am using

Private Function readHtmlPage(ByVal url As String) As [String]
Dim result As [String]
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim sr As New StreamReader(objResponse.GetResponseStream())
Try
result = sr.ReadToEnd()
' Close and clean up the StreamReader
sr.Close()
Finally
sr.Dispose()
End Try
Return result
End Function

I cannot find any documentation on how to fix this problem.

THANKS!

Mar 10 '06 #3
It's hard to tell. (a) outlook could be blocking it...more likely, the aspx
file has somet type of leeching protection built-into it. They might check
for referrer or somethig...it's hard to tell.

Karl
--
http://www.openmymind.net/

"TCB" <tc******@hotmail.com> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
Thank you, got that part working. Now the page i am trying to send
contains some thumbnails generated by another .aspx webform so the image
source for those images is something like:

src="http://www.mydomain.com/MidThumbnail.aspx?AdId=40&amp;Type=1&amp;HorSize=1 60&amp;VerSize=120&amp;ImageNo=1

But this images do not load in outlook when I open the mail message

THANKS
"TCB" <tc******@hotmail.com> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
I am getting this error while tryin to read the contents of a Web page so
I can send them in an email:
"Too many automatic redirections were attempted."

This is the code I am using

Private Function readHtmlPage(ByVal url As String) As [String]
Dim result As [String]
Dim objResponse As WebResponse
Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
objResponse = objRequest.GetResponse()
Dim sr As New StreamReader(objResponse.GetResponseStream())
Try
result = sr.ReadToEnd()
' Close and clean up the StreamReader
sr.Close()
Finally
sr.Dispose()
End Try
Return result
End Function

I cannot find any documentation on how to fix this problem.

THANKS!


Mar 10 '06 #4

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

Similar topics

0
by: Adam | last post by:
I have an application which interacts with a webserver over https using client certificates. Due to a bug in openssl 0.9.6, I upgraded to 0.9.7 and rebuilt python. Now, when I access the page...
1
by: Ron Holmes | last post by:
I posted this question on the Crystal Reports Support site and I am still waiting for an answer. Using Crystal Reports 9.0 Developer Full edition: My Crystal report .RPT file has a Picture box...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
by: Ersin Gençtürk | last post by:
Server : WEB System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Web.HttpException: The View State is invalid for this page and might be...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
2
by: Chuck Ritzke | last post by:
Hi all, I am getting an intermittant error after uploading a project from my development machine. I click on a link which opens an aspx page that, upon page load, reads a very small amount of...
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
0
by: Edward | last post by:
I'm strictly a high-level programmer, so please excuse my ignorance of the inner magic of ASP etc. I have what my company calls a "builder form". It is used to maintain static lookup lists. It...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
2
by: vijayrvs | last post by:
SearchCrawler.java The program search crawler used to search the files from the website. From the following program i got 7 compiler error. can any body clarify it and provide me solution. ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.