<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
jQuery 자동 완성을 ajax 및 json 데이터와 함께 사용하고 있지만 선택한 결과를 요소에 추가하면 문제가 발생합니다. ex->http://jqueryui.com/autocomplete/#remote-jsonp ol, div, p 및 ul에 잘 추가 할 수 있지만 asp : ListBox에 추가하여 결과 서버 쪽을 쉽게 바인딩 할 수 있습니다.appending ListBox
아래 함수는 내 ListBox를 그냥 비 웁니다. 왜 새로운 요소를 추가하는 것이 효과가 없는지 확신 할 수 없습니다.
function log(message) {
$("#<%= lbx_log.ClientID %>").text(+"<asp:ListItem Text=\""+message+"\" />").appendTo("#log");
}
HTML/ASP
<div >
<asp:ListBox runat="server" id="lbx_log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content">
<asp:ListItem Text="blank" />
</asp:ListBox>
</div>
<asp:Button runat="server" ID="btn_back" Text="Back ←" OnClick="btn_back_Click" />
<asp:Button runat="server" ID="btn_save" Text="save" OnClick="btn_save_Click" />
<asp:Button runat="server" ID="btn_next" Text="Next →" OnClick="btn_next_Click" />
</div>
</form>
</body>
클라이언트에서 100 % 발생하기 때문에 서버 측 코드가 유용하지 않은 것은 질문에 대한 답변입니다. .NET 코드가 아닌 HTML을 표시하십시오. –