<script>
var ArrayString;
$(function () {
ArrayString = <%=GetInstitutionsArray() %>;
$("#tags").autocomplete({
source: ArrayString,
select: function( event, ui ) {
$("#Label1").val(ui.ID);
}
});
});
我正在使用这个jquery来创建一个自动完成列表..GetInstitutionsArray()
是后面代码中的一个函数,它创建一个看起来像这样的对象数组..
ArrayString = [{label: "Centre of Professional Training Sezimovo st",ID:9695},
{label: "Kunshan Industrial Technology Research Institute",ID:10079},
{label: "Gh Asachi Technical University of Iasi",ID:10186},
{label: "KAZDIDAKTIK Ltd",ID:9427},
{label: "3D Perception AS",ID:7796},
{label: "A D PatelInstitute of Technology",ID:7390},
{label: "A Star Singapore BioImaging Consortium",ID:8706},
{label: "A James Clark School of Engineering",ID:9005},
{label: "ADPatel Institute of Technology",ID:9151},
{label: "AM AlKhorafi",ID:7296},
{label: "AAI Corporation",ID:7795}];
Label1
选择标签时,我试图将机构 ID 的 ID 放入标签中。
<asp:Label ID="Label1" runat="server"></asp:Label>
id 未显示在选择中