Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在asp.net中从表单元格调用JavaScript函数?_C#_Javascript_Asp.net_Tablecell - Fatal编程技术网

C# 如何在asp.net中从表单元格调用JavaScript函数?

C# 如何在asp.net中从表单元格调用JavaScript函数?,c#,javascript,asp.net,tablecell,C#,Javascript,Asp.net,Tablecell,我已经创建了一个Asp页面,其中有一个链接 我的代码是: CheckBox selectImage; Label lblTitle; Label lblResolution; Label lblFileType; LinkButton lbDownload; System.Web.UI.WebControls.TableRow row; System.Web.UI.WebControls.TableCell cellSelectImage; System.Web.UI.WebControls.

我已经创建了一个Asp页面,其中有一个链接

我的代码是:

CheckBox selectImage;
Label lblTitle;
Label lblResolution;
Label lblFileType;
LinkButton lbDownload;

System.Web.UI.WebControls.TableRow row;
System.Web.UI.WebControls.TableCell cellSelectImage;
System.Web.UI.WebControls.TableCell cellScriptFunction;
System.Web.UI.WebControls.TableCell cellTitle;
System.Web.UI.WebControls.TableCell cellResolution;
System.Web.UI.WebControls.TableCell cellFileType;
System.Web.UI.WebControls.TableCell cellFileDownload;
foreach (SPListItem image in returnedImages)
{
    row = new System.Web.UI.WebControls.TableRow();
    cellSelectImage = new System.Web.UI.WebControls.TableCell();
    selectImage = new CheckBox();
    cellSelectImage.Controls.Add(selectImage);
    cellScriptFunction = new TableCell(); // in this table cell I want to place the control which is returned from the javascript                                

}

如何实现这一点?

您可以使用TableCell.Text包含脚本


你试过注册表启动脚本了吗
  cellScriptFunction = new TableCell(); // in this table cell I want to place the control which is returned from the javascript                                


cellScriptFunction.Text = "<script> Vizit.Write(\"http://path/to/file.ext\", { buttons: [ \"InstantPreview\" ] }); </script>";