Fire An Asp.net Textbox Event On Enter Press
How do i fire a ASP.NET click event when the user press enter. This is what i do now but it does not work: function KeyDownHandler(event) { if (event.keyCode == 13) { _
Solution 1:
Try to use the Panel.DefaultButton Property
Solution 2:
i used this exsample to make it work Panel.DefaultButton Property Exsample
Solution 3:
$(document).ready(function(){
$(window).keydown(function(e){
if(e.keyCode == 13) $('#<% ButtonGetListforUser.ClientID %>'.click();
});
});
Solution 4:
This answer for C# ASPNET Control name : Textbox1
Add TextChanged event for the textbox then add your code in this block as below.
protectedvoidTextbox1_TextChanged(object sender, EventArgs e) { // Add your code here }
Add below block to add Enter event to textbox
privatevoidTextbox1_Enter(object sender, System.EventArgs e) { Textbox1_TextChanged((object)sender, (EventArgs)e); }
Post a Comment for "Fire An Asp.net Textbox Event On Enter Press"