![](/img/trans.png)
[英]How to show popup with progress bar using ajax and jquery in update panel
[英]How to access Controls in Update Panel by using JQuery
我想通过将带有webservice的jquery用于updatepanel中的中继器“ repAbc”中的文本框控件“ txtAbc”来执行自动完成。 自动完成功能仅在更新面板回发之前起作用。 回发后,它不起作用。
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Repeater ID="repAbc" runat="server" OnItemCommand="repAbc_ItemCommand"
OnItemDataBound="repAbc_ItemDataBound">
<ItemTemplate>
<asp:TextBox ID="txtAbc" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
$(function () {
$("[id$=txtAbc]").autocomplete({
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/Services.asmx/GetAbcMethod") %>',
data: "{ 'prefix': '" + escape(request.term) + "', 'varType':'eqType'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item
}
}));
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
minLength: 1
}); });
</script>
我通过添加pageLoad()函数解决了这一问题。
<script type="text/javascript">
function pageLoad() {
$(function () {
// Textbox Autocomplete function here...
});
}
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.