0
我創建了一個ASP頁面,其中有一個<asp:Table>
對象。我將從後面的代碼動態生成行。如何從asp.net中的表格單元調用JavaScript函數?
在表格中的一個單元格中,我想調用JavaScript函數。 JavaScript函數是:Vizit.Write("http://path/to/file.ext", { buttons: [ "InstantPreview" ] });
,這行代碼將返回控件。並且我想把這個返回的控件放在TableCell中。要知道,這個的實際含義是什麼,你可以參考this的鏈接。
我的代碼是:
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
}
如何做到這一點?
沒有ü嘗試registerstartup腳本包括腳本 – sakir