User Controls with Form fields & Multiple Submits

G

Guest

Let's say I have a page which contains a bunch of text boxes and a Button.
Then, also on the same page, I have a User Control I've created which has two
text boxes and a button of its own.

Here's my problem: In this case, when someone's typing in the textboxes on
the page itself and they press the ENTER key, OR if they're typing in the
text boxes of the UserControl and they press the ENTER key, how do I make
sure that the proper submit button receives the click?

In old fashioned HTML, this was done by creating multipple FORMs on a page
and then the browser handled it. In ASP.NET I really don't know what to do.
Do I have to right client-side JavaScript? If so, what do I have to do? Do I
have to create a JS function for each time an onfocus occurs on every text
box of the page? If so, what would that JS do? Or is there a property of the
TextBox object which allows you to automatically define the default "Button"
it pushes if the user hits enter?

Confused.

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top