Issue with Multiple Submit Buttons

G

Guest

Hi,

I have a web form where a user can enter child parts for a given parent part.

On the top of the page is a text box and a sumbit button labeled "Retrieve
Child Parts". When type some part number and press enter all child parts for
the given parts are retrived from a db table and bound to a Datagrid. The
data grid has 3 columns, child part number, child part description and delete
column. the delete column is a templated column where there is a Imagebutton.
when the user clicks on the image the child part is deleted. Below the grid
is another textbox and a submit button labled "Add Child Part". The
requirement is that when the user wants to enter a new Child Part, all he has
to do is type the part number and hit enter. however in my case if the user
hits enter in the add new child part text box, instead of trigger the add new
child part button "on click", it triggers the "on click" of the last delete
image button in the grid. How do I control it in such a way as to have the
sumbit button and not the image button is clicked.
 
G

Guest

You can set focus on particular buttons in an ASP.NET application, but you
will have to set it on a return trip, if you wish to use the server app to do
it.

Page.RegisterHiddenField( "__EVENTTARGET", "ButtonNameHere" );

If all of your actions are clients side until a "save" button is clicked,
you will have to do this with JavaScript. You can build a custom wrapper of
the DataGrid to have this funcationlity automatically applied (ie, write the
JavaScript once and have it default behavior of your custom DataGrid).

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top