How to trigger an UpdatePanel by a TextBox control?

会有一股神秘感。 提交于 2019-12-01 17:08:37
Erik Dekker

You can do this to refresh your updatepanel without the button:

<script type="text/javascript">

    function refreshPanel() {
        __doPostBack('<%= updatePanel.UniqueID %>', '');
    }

</script>
<label>Search:</label>
<asp:TextBox runat="server" ID="search"  
                ClientIDMode="Static" OnKeyUp="refreshPanel();" />
<asp:UpdatePanel runat="server" ID="updatePanel">

You just need to give your updatepanel an ID (updatePanel here)

Execute that code on a keyup or whenever you are ready for it.

The link is a bit outdates, but should pretty much do what you want:
http://remy.supertext.ch/2007/06/see-search-results-as-you-type-an-aspnet-ajax-control/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!