asp.net - c# keydown code not working -


i have textbox used make research keyword. have checkboxes filter results , graph display occurences of keyword in table. search done once click on button made it, works if click on enter key. problem if decide check 2 checkboxes , click on enter, research not made, or if change keyword , click again on enter result of graph not made. i'd work whenever click on button or enter.

i'm using keydown saw on internet it's not changing anythhing, no error either.

my code :

        protected void btnsearch_click(object sender, eventargs e)         {             populate();          }          protected void tbsearch_keydown(object sender, keyeventargs e)          {             if (e.keycode == keys.enter)                 btnsearch_click(null, null);         } 

can me ?

on textbox,

  • add attribute autopostback="true"
  • add attribute ontextchanged="btnsearch_click"

and want without jquery

--> autopostback: postback server when event triggered

--> ontextchanged: when out of textbox (or press enter), event triggered , go search function


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -