The whole idea is that when the value of the text box is changed, the event is triggered and the values in the list are filtered.
According to this idea, the first thing to be solved is to determine what events in the text box can meet the requirements, when the first thought is onkeydown or onkeypress, in the process of the trial found again input Chinese, can not respond, because the input side will focus to shield. Searching the internet for a while Onpropertychange events will start when you change text attributes, so when you enter data in a text box it is actually changing the value property of the text box. And Chinese can also be satisfied, this thought is done, finally found this event for IE exclusive event, other browsers do not have the event. and the corresponding oninput can satisfy the demand.
The concrete implementation is that the text box, the hidden button, when the text box is entered, calls the Onpropertychange or Oninput event, finds the hidden button in this event, and then departs his click event, In this way we only need to filter the list data in the Click event of the Hidden button in the background (of course, the event of the starting and hiding button is done with JavaScript, and the Clienid of the server-side control in the foreground) script code is as follows:
Copy Code code as follows:
<script type= "Javascript/text" language= "JavaScript" >
function Btnclick ()
{
var Btnid = "<%=this.btnSearch.ClientID%>";
var btnobject = Document.getelementid (Btnid);
if (Btnobject)
{
Btnobject.click ();
}
}
</script>