Click here to Skip to main content
15,922,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am using MVC framework.

I am displaying set to records in Table format.

When User click to a Particular row that row need to updated.

Example:
Table:
Name value Isactive
Linkbutton ABC test True

Linkbutton ddc tes False

Linkbutton ddd ddd True

when user click the Linkbutton if Isactive value = true then it need to change false, viceversa.

Please help me..

Thanks In Adance...
Posted

1 solution

What I would do is this:

1) Make sure each row has a unique ID.
2) When clicked, make an Ajax call with the ID of the row to a controller action that toggles the state (ToggleAction(int recordId, bool currentState). It would make the call into your repository and record the desired new state passed in from the call.
3) The action would return a partial view, which is the newly rendered row. Alternatively, it can be a simple signal.
4) On the success event of the Ajax call, replace the contents of the row (or evaluate your response and alter the cell).

Check my sig for my blog - I have a series started on MVC + jQuery, which may be what you're looking for.

Cheers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900