Page_Load에 써준다..

 

searchTXT.Attributes["onkeypress"] = " if( event.keyCode == 13 ){" + Page.GetPostBackEventReference(Button1) + "; return false;}";

 

브라우저 소스보기를 하면 다음의 결과가 나타난다..

<input name="searchTXT" type="text" id="searchTXT" onkeypress=" if( event.keyCode == 13 ){__doPostBack('Button1',''); return false;}" />

<input type="submit" name="Button1" value="검색" id="Button1" />


Posted by 뭉치냐옹
: