Refresh WebForm

N

NN

Hello, I have a problem :)

I have a webform in which I have the event Onload that refers to a script
that find in a database for an image and then show it in the WebForm. The
problem is that I want to repeat the search automatically every 5 seconds. I
Already tried with <meta http-equiv="refresh" content="5"/> but if i having
the OnLoad in the form, does not do anything, does not refresh. I don't know
what to do : (

I hope that someone could help, for the doubts I pass the code of the
script. Thank you very much!


<script runat="server">
Public Sub MostrarImagen(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim cadena As String = "Database=vigilancia;DataSource=localhost;User
Id=root;password=vigilancia"

Dim query As String = "Select * from imagenes"

Dim conn As New MySqlConnection(cadena)

Dim da As New MySqlDataAdapter(query, conn)

Dim ds As New DataSet

conn.Open()

da.Fill(ds, "Vigilancia")

Dim contador As Integer

contador = ds.Tables("Vigilancia").Rows.Count

Dim myRow As DataRow

myRow = ds.Tables("Vigilancia").Rows(contador - 1)

Dim myData() As Byte

myData = myRow("imagen")

Response.Buffer = True

Response.ContentType = "Image/JPEG"

Response.BinaryWrite(myData)

End Sub

</script>
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

You can't send both a page and a binary image to the browser. As you are
sending an image, you don't have a page any more, so there is no page
header where you can put the meta tag.
 
N

NN

So? No solution?

Göran Andersson said:
You can't send both a page and a binary image to the browser. As you are
sending an image, you don't have a page any more, so there is no page
header where you can put the meta tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top