尝试从 gridview 中的超链接调用 javascript 函数时出现以下错误。
(未知源位置)中的 JavaScript 严重错误
SCRIPT1006: 应为 ')'
函数中的警报甚至没有显示。提前致谢。
function EditResource(sResourceID, sTravelMName, sChronoMName) {
alert("test");
var options = {
url: "http://192.168.9.12:1002/SitePages/ResourceEdit.aspx?ResourceID=" + sResourceID + "&TravelManagerName=" + sTravelMName+ "&ChronoManagerName=" +sChronoMName,
title: "Edit Resource",
autoSize: true,
dialogReturnValueCallback: DialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}
超链接代码
<asp:HyperLink runat="server" CssClass="padding5" ID="hpEdit" ToolTip="Set Manager" ImageUrl="../_layouts/15/images/Test/Icons/icon_edit.png" NavigateUrl='<%# "javascript:EditResource(" + Eval("Resource_ID") + "," + Eval("Travel_Manager_Full_Name") + "," + Eval("Chrono_Manager_Full_Name")+")" %>'></asp:HyperLink>