C# 如何在asp.net中从表单元格调用JavaScript函数?
我已经创建了一个Asp页面,其中有一个链接 我的代码是: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.
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>";