FineUI下实现Enter键搜索功能
<f:TextBox ID="txt_name" runat="server" Label="项目名称" LabelWidth="80px"> <Listeners> <f:Listener Event="specialkey" Handler="onTextBoxSpecialkey" /> </Listeners> </f:TextBox>
<script type="text/javascript"> function onTextBoxSpecialkey(box, e) { if (e.getKey() == e.ENTER) { __doPostBack('', 'Enter_Key_Action_Search'); } } </script>
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindData(); } else { if (Request.Form["__EVENTARGUMENT"].ToString() == "Enter_Key_Action_Search") { btn_search_click(null, null); } } }