tags:

views:

31

answers:

3

Hi all, When i click a particular video in grid view that video should be played in a new window.

When i click a video in grid view i will check certain conditions in server side page. Only if that condition is true i want to play that video in new window (or) tab.

If that condition is false then i want to play the selected video in the same page itself.

This is my code:

if(videoCategoryName.CategoryName=="Syndicated Videos")
{ 
  string url = www.planetwrox.com + "/" +  "default.aspx?q=videoid
  string fullURL = "window.open('www.google.com', '_blank', 'height=500,width=800');";
  ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
}

But new is not opened. instead the video plays in the same window.

Can any one provide some ideas or code to solve this issue.

A: 

Try var win = window.open() instead of just window.open()

Josh
+1  A: 

i can see one extra single quote before height=500, which is not closed. Is that the reason!

Anil
I even added, the closing quotes even then its not opening in a new window.....Is there any other way to implement this task...Ur thoughts
you can place your video control into anchor tags<a href=..."> video control </a>attach href source to these anchor tag at run time to open corresponding videos...else you can may be find your answer herehttp://forums.asp.net/t/1517167.aspx
Anil
+1  A: 

Here's how I do it using jQuery:

ClientScriptManager clientScriptManager = Page.ClientScript;
string scriptText = "$(document).ready(function() { window.open('http://www.google.com'); });";
clientScriptManager.RegisterClientScriptBlock(this.GetType(), "MyScript", scriptText, true);
CyberDude