Re: Embedding another page into my page
- From: "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com>
- Date: Wed, 7 Sep 2005 13:52:11 -0500
Oh, and change the content type in the code from jpg to gif.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"J-T" <J-T@xxxxxxxxxx> wrote in message
news:u9%23q2o9sFHA.908@xxxxxxxxxxxxxxxxxxxxxxx
> Sorry,I guessed I am misleading you by bad explanation.
>
> The source is a page that contains the image :
>
> http://www.tehrantraffic.com/gif.asp?g=cam3_ttcc_00001.jpg&t=TTCC%20website
>
> page gif.asp ultimately contians this picture :cam3_ttcc_00001.jpg !The
> picture is being updated every 2 minues and that's why I need to update my
> hosting user control in 2 minutes as well to show latest picture.I have no
> access to the image so any relative path to the image dosen;t work,the
> only thing I have access to is the URL I mentioned above.
>
> Thanks a lot for the help
>
> "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
> message news:eUcF$b9sFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
>> In that case you could create a .aspx page that sends the image to you
>> using the response object.
>>
>> You would then set the link of your image to the imagedelivery.aspx page.
>>
>> The code for the delivery page would be like this:
>>
>> '------------------------------------------------------------------------------------------
>> 'Sub: Page_Load DateCreated:8/26/2005 By: S. Justin Gengo DateModified:
>> By:
>> '
>> ' Comments:
>> ' Delivers an image from the image table stored in memory as a
>> stream.
>> '------------------------------------------------------------------------------------------
>> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles MyBase.Load
>> Dim MemoryStream As System.IO.Stream
>> Try
>> Response.Clear()
>> Response.ContentType = "image/jpeg"
>>
>> Dim ImageWebRequest As System.Net.WebRequest
>>
>> ImageWebRequest = System.Net.WebRequest.Create(New
>> Uri("http://www.mywebapp/uri of image here.jpg"))
>> ImageWebRequest.Timeout = 2000
>>
>> '---Get the response produced by the request
>> Dim Response As System.Net.WebResponse =
>> ImageWebRequest.GetResponse
>>
>> '---Download the page content into a stream
>> MemoryStream = Response.GetResponseStream
>>
>> Response.BinaryWrite(MemoryStream.GetBuffer)
>> Catch ex As Exception
>> '---Handle any errors here.
>> Finally
>> If Not MemoryStream Is Nothing Then
>> MemoryStream.Close()
>> MemoryStream = Nothing
>> End If
>> End Try
>> End Sub
>>
>>
>> Then set your link to the image delivery page. You could even tack on a
>> random number as a querystring id to the default page's url each page
>> load something like:
>>
>> Image1.ImageUrl = "http://www.mywebapp.com/imagedelivery.aspx?id=" &
>> Rnd.ToString & Rnd.ToString
>>
>> The query string will make the client browser think that the image url
>> has changed every page load. Thus, no caching of images.
>>
>> --
>> Sincerely,
>>
>> S. Justin Gengo, MCP
>> Web Developer / Programmer
>>
>> www.aboutfortunate.com
>>
>> "Out of chaos comes order."
>> Nietzsche
>> "J-T" <J-T@xxxxxxxxxx> wrote in message
>> news:eDGFoJ9sFHA.256@xxxxxxxxxxxxxxxxxxxxxxx
>>>
>>> Always same picture.URL never gets changed!!!
>>>
>>> Thanks
>>>
>>> "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
>>> message news:eDAiNC9sFHA.616@xxxxxxxxxxxxxxxxxxxxxxx
>>>> J-T,
>>>>
>>>> Is it always the same picture you're after? Or will the url change?
>>>>
>>>> --
>>>> Sincerely,
>>>>
>>>> S. Justin Gengo, MCP
>>>> Web Developer / Programmer
>>>>
>>>> www.aboutfortunate.com
>>>>
>>>> "Out of chaos comes order."
>>>> Nietzsche
>>>> "J-T" <J-T@xxxxxxxxxx> wrote in message
>>>> news:ew3TW88sFHA.3424@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Thanks for the reply.
>>>>>
>>>>> I used the way that you suggested ,but the problem is that it is
>>>>> returing relative path to the picture which is in the page and
>>>>> because that picture dosen;t exist in my website ,the picture is not
>>>>> showig up well.Page contains a relative path to the picture and page
>>>>> is not part of my website,I am getting its content from a website to
>>>>> which I have to access.When I use iframe the whole page is rendered
>>>>> and then I don;t care about the paths in the page.
>>>>>
>>>>> Any suggesions?
>>>>>
>>>>> Thanks agian
>>>>> "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote
>>>>> in message news:uFmK5i6sFHA.3620@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>> Another possibility would be to use a web request and a literal
>>>>>> control. This is the method I prefer because you can check if the
>>>>>> request is valid and handle the possibility of the page you're
>>>>>> requesting not showing up...
>>>>>>
>>>>>> Something along these lines:
>>>>>>
>>>>>> '---Create the request
>>>>>>
>>>>>> Dim WebRequest As System.Net.WebRequest =
>>>>>> System.Net.WebRequest.Create(New
>>>>>> Uri(CurrentLink))
>>>>>>
>>>>>> WebRequest.Timeout = 2000
>>>>>>
>>>>>> '---Get the response produced by the request
>>>>>>
>>>>>> Dim Response As System.Net.WebResponse = WebRequest.GetResponse
>>>>>>
>>>>>> '---Download the page content into a stream
>>>>>>
>>>>>> Dim Stream As System.IO.Stream = Response.GetResponseStream
>>>>>>
>>>>>> '---Place the stream into a stream reader
>>>>>>
>>>>>> Dim StreamReader As New System.IO.StreamReader(Stream)
>>>>>>
>>>>>> '---Read the stream into a string object
>>>>>>
>>>>>> Dim HtmlReceived As String = StreamReader.ReadToEnd
>>>>>>
>>>>>> '---Place the string into a literal control
>>>>>>
>>>>>> Literal1.Text = HtmlReceived
>>>>>>
>>>>>> '---Cleanup
>>>>>>
>>>>>> Stream.Close()
>>>>>>
>>>>>> StreamReader.Close()
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sincerely,
>>>>>>
>>>>>> S. Justin Gengo, MCP
>>>>>> Web Developer / Programmer
>>>>>>
>>>>>> www.aboutfortunate.com
>>>>>>
>>>>>> "Out of chaos comes order."
>>>>>> Nietzsche
>>>>>> "Onin Tayson" <Leon_Tayson@xxxxxxxxxxx> wrote in message
>>>>>> news:%23NZCWT3sFHA.1132@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>> Yep! <iframe> will do.
>>>>>>>
>>>>>>> <iframe
>>>>>>> src="http://www.tehrantraffic.com/gif.asp?g=cam3_ttcc_00001.jpg&t=TTCC%20website"></iframe>
>>>>>>>
>>>>>>>
>>>>>>> "Axel Dahmen" <NO_SPAM@xxxxxxxxxxxxxxxxxx> wrote in message
>>>>>>> news:OtB8K11sFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>> I'd try an <iframe> element.
>>>>>>>>
>>>>>>>> HTH,
>>>>>>>> Axel Dahmen
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------
>>>>>>>> "J-T" <Reza@xxxxxxxx> schrieb im Newsbeitrag
>>>>>>>> news:eHBZmt1sFHA.1284@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> There is a picture on the following URL which I want to have it in
>>>>>>>>> one of
>>>>>>>>> my asp.net pages .I mean I want to embed the content of this page
>>>>>>>>> in my
>>>>>>>> own
>>>>>>>>> page and get its image.Is there a control or tecnique which I can
>>>>>>>>> accomplish this?
>>>>>>>>>
>>>>>>>>>
>>>>>>>> http://www.tehrantraffic.com/gif.asp?g=cam3_ttcc_00001.jpg&t=TTCC%20website
>>>>>>>>>
>>>>>>>>> Thanks a lot
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: Embedding another page into my page
- From: J-T
- Re: Embedding another page into my page
- References:
- Embedding another page into my page
- From: J-T
- Re: Embedding another page into my page
- From: Axel Dahmen
- Re: Embedding another page into my page
- From: Onin Tayson
- Re: Embedding another page into my page
- From: S. Justin Gengo
- Re: Embedding another page into my page
- From: J-T
- Re: Embedding another page into my page
- From: S. Justin Gengo
- Re: Embedding another page into my page
- From: J-T
- Re: Embedding another page into my page
- From: S. Justin Gengo
- Re: Embedding another page into my page
- From: J-T
- Embedding another page into my page
- Prev by Date: Re: Embedding another page into my page
- Next by Date: Re: VS.NET is 10 times slower than VB6
- Previous by thread: Re: Embedding another page into my page
- Next by thread: Re: Embedding another page into my page
- Index(es):
Relevant Pages
|