I have a textbox and a button.
The button has a btn_click(obj, eventargs) on codebehind.
This is on master page.
What I want is when the textbox is focused and click enter,
I want to run that function, in other words, click the button.
So, I wrote…
$("#" + "<%= txtSearch.ClientID %>").keypress(function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) {
$("#" + "<%= imgBtnSearch.ClientID %>").click();
}
On server side function, I am redirecting to another page.
Since it is not redirecting, can i assume that it is not working?
Is there anything I can make it work?
});
This is it: