Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
WebGrid and YouTube videos
posted

Hi,

I have a webgrid with TWO columns .

Column 1 shows a picture. Column 2 shows the code to embed from Youtube

For instance:

<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/-tOTebN2kMw&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-tOTebN2kMw&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>

In my page there is a <SPAN> where I put the video I select from the grid when I click Column 1.

But everytime I click it, the page refreshes itself with a postback.

What can I do to have the <SPAN> show the video without refreshing the page ?

I am using :

Private Sub gridMedia_SelectedRowsChange(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.SelectedRowsEventArgs) Handles gridMedia.SelectedRowsChange

 

 

If Me.gridMedia.Rows(Me.gridMedia.DisplayLayout.ActiveRow.Index).Cells(3).Value.ToString.StartsWith("<object"Then

 

 

Me.SpanVideos.Visible = True

 

 

Me.SpanVideos.InnerHtml = Me.gridMedia.Rows(Me.gridMedia.DisplayLayout.ActiveRow.Index).Cells(3).Value.ToString

 

 

Else

 

 

Me.SpanVideos.InnerHtml = ""

 

 

Me.SpanVideos.Visible = False

 

 

End If

 

 

End Sub

What can I do ?

Something in the client side ?

THX !!