Andrea,
Steve is correct. If you want to perform some functionality if the
textbox is changed and the user hits enter, then the following code snippet
may be useful: (if textbox isn't changed, the event will not fire).
private void btn_Click(object sender, System.EventArgs e)
{
Trace.Warn("Button Clicked");
}
private void txt_TextChanged(object sender, System.EventArgs e)
{
btn_Click(sender, e);
}
Or if there is something that needs to be done on every postback, you may
just want to put that logic in Page_Load and check that IsPostBack is true.
--
Best regards,
Jeffrey Palermo
Blog:
http://dotnetjunkies.com/weblog/jpalermo
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl...
I agree that this default behavior is non-intuitive, but that's just how
it works.
Luckily you can override this default functionality and implement
functionality of your own.
Here's a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp
You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Andrea" <an****@totalshareware.com> wrote in message
news:co**********@news.ngi.it...I have a text box and a Button.
If I click on the button, the page is posted and the Click event is
fired. If I hit return on the text box (the browser should post the page like
click on button) the page is posted, but the click event is not fired.
Someone can help me on this problem.
Thanks.
Andrew