scroll:true })。focus(function(){ $ auto(this).autocomplete(search,); }); } < / script> 谢谢你们所有 我尝试过: 1-javascript pageload {my code} 2-asp按钮单击:ScriptManager.RegisterStartupScript(this,this.GetType(),bc,BindControls();,true); 3-div onload =BindControls() 4-Update Panel 解决方案 auto = jQuery.noConflict(); auto(window).load(function(){ BindControls(); }); functi在BindControls(){ var auto = jQuery.noConflict(); var saltur =<%= pricearray%> hi all,i using dynamic auto complete inputs.RecreateDynamicTextboxes() function working but autocompletes inputs not working after postback.How I can do it?thanks u allJquery Codes: <script type="text/javascript"> function GetDynamicTextBox(value,text){ return ' <input class="DynamicSelect form-control" maxlenght="250" style="width:300px;" placeholder="" id="tbCountries" onfocus="BindControls(); " autocomplete="off" name="DynamicSelect" type="text" value = "' + text + '" /> ' + '<input maxlength="5" placeholder="Price" name = "DynamicTextBox" type="text" value = "' + value + '" onkeypress="return event.charCode >= 48 && event.charCode <= 57"/> ' + '<input type="button" value="Remove" onclick = "RemoveTextBox(this)" />' } function GetDynamicTextBox2(value) { return ' <input class="DynamicSelect form-control" maxlenght="250" style="width:300px;" placeholder="" id="tbCountries" onfocus="BindControls(); " autocomplete="off" name="DynamicSelect" type="text" /> ' + '<input placeholder="Price" maxlength="5" name = "DynamicTextBox" type="text" value = "' + value + '" onkeypress="return event.charCode >= 48 && event.charCode <= 57"/> ' + '<input type="button" value="remove" onclick = "RemoveTextBox(this)" />' } function AddTextBox() { var div = document.createElement('DIV'); div.innerHTML = GetDynamicTextBox2(""); document.getElementById("TextBoxContainer").appendChild(div); BindControls() } function RemoveTextBox(div) { document.getElementById("TextBoxContainer").removeChild(div.parentNode); } function RecreateDynamicTextboxes() { var values = eval('<%=Values%>'); var values2 = eval('<%=SVal%>'); if (values != null) { var html = ""; for (var i = 0; i < values.length; i++) { for (var i = 0; i < values2.length; i++) { html += "" + GetDynamicTextBox(values[i],values2[i]) + ""; } } document.getElementById("TextBoxContainer").innerHTML = html; } } window.onload = RecreateDynamicTextboxes; </script> <script type="text/javascript"> var $auto = jQuery.noConflict(); $auto(window).load(function () { BindControls(); }); function BindControls() { var $auto = jQuery.noConflict(); var saltur =<%= pricearray%> $auto('.DynamicSelect').autocomplete({ source: saltur, minLength: 0, scroll: true }).focus(function() { $auto(this).autocomplete("search", ""); }); }</script> thanks u allWhat I have tried:1-javascript pageload { my codes }2-asp button click :ScriptManager.RegisterStartupScript(this, this.GetType(), "bc", "BindControls();", true);3-div onload=" BindControls()"4-Update Panel 解决方案 auto = jQuery.noConflict();auto(window).load(function () { BindControls(); }); function BindControls() { varauto = jQuery.noConflict(); var saltur =<%= pricearray%> 这篇关于在ASP.NET中回发后,Jquery自动完成功能无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-05 07:00