Hi
I have a strange problem. I have a thumbnail for a random picture, with the following code in my page_load event to generate it.
Code:
...
Dim PicCount = From pic In myEnt.Pictures
Select pic
Dim rand As New Random()
Dim randomImg As Int16 = rand.Next(0, PicCount.Count - 1)
Dim randImg = From pic In myEnt.Pictures
Order By pic.Id Ascending
Skip randomImg
Select pic
FormView4.DataSource = randImg
FormView4.DataBind()
...
In the click event sub i have this code:
Code:
Using myEnt As New PicturesEntities()
Dim imgb As ImageButton = FormView4.FindControl("Rand")
Dim rImg = From pic In myEnt.Pictures
Order By pic.Id
Where pic.ThumbnailUrl = imgb.ImageUrl
Select pic.Id
Response.Redirect(String.Format("~/?={0}", rImg.First))
End Using
Now, my problem is that when i click the thumbnail, i just go to a random site and not the one wich is previewed by the thumbnail. I have tried several different solutions wich all should work, atleast in my little mind

but with the same result every time.
I guess i am not finding the "right" ImageButton, but im too green to figure out why.