Click here to Skip to main content
15,886,535 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
Hi,


I have to call escape key in my C# code (ASP.NET),so please help me,how to call that key in C# code.


Thanks.
Posted
Comments
Prerak Patel 12-Sep-11 2:00am    
Describe the problem.
Pravinjas 12-Sep-11 2:23am    
I have to cancel search process if it take to long time.if i press escape then it is stop
Tejas Vaishnav 12-Sep-11 2:26am    
But what you want with ESC key please describe the problem in brief

1 solution

Try jQuery
C#
function simulateESCKeyPress() {
  jQuery.event.trigger({ type : 'keypress', which : 27 });
}

$(function() {
  simulateESCKeyPress();
});
 
Share this answer
 
Comments
Pravin Patil, Mumbai 12-Sep-11 2:23am    
Great answer...My 5.
Prerak Patel 12-Sep-11 4:43am    
Thanks Pravin

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900