asp.net mvc getting id of button clicked

Posted by mazhar kaunain baig on Stack Overflow See other posts from Stack Overflow or by mazhar kaunain baig
Published on 2010-05-29T20:35:01Z Indexed on 2010/05/29 20:42 UTC
Read the original article Hit count: 201

Filed under:
|
 <div id="4591" >
            <input type="text" id="Title1" name="Title1"  value="a" />
            <input type="submit" name="button"  value="Save" /> </div>

<div id="4592" >
            <input type="text" id="Title2" name="Title2"  value="a" />
            <input type="submit" name="button"  value="Save" /> </div>

  <div id="4593" >
            <input type="text" id="Title3" name="Title3"  value="a" />
            <input type="submit" name="button"  value="Save" /> </div>

This is the copy paste version of the html source generated by the browser which is making it clear that i am generating the dynamic fields on the page. name in the textbox is the field in the database. After pressing the one of the save buttons how would i send the particular textbox name and value to the controller action to be updated.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc