Custom button doesn't pass parametrs to controller

Nov 28, 2013 at 2:17 PM
I have costumized a grid with button, I need to pass row data to the controller.
The grid have 30 rows but when i click the buttons the controller recive always the data of the first row, ignoring the value of the current row.

My Code Mvc- Razor:
In the grid:
@Html.Grid(Model).Columns(columns =>
   .RenderValueAs(o => __MyButton__(o));

   columns.Add(o => o.NDG)


where MyButton is :

@helper MyButton(Model R)
Html.BeginForm("SendEmail", "Email", new { NDG = R.NDG, eMail = R.eMail }, FormMethod.Post);
<input type="submit" value="Send mail" name="btnEmail" "/>
<label>@Html.DisplayFor(X => R.NDG)</label>


In the controller:

public string SendEmail(String NDG, string eMail)
        string ObjM = "Mcv test " + NDG;

        return "ok";

In the controller NDG have Always the value of the first row of the grid.
Please, can you help me?

Dec 19, 2013 at 2:46 AM
Hello ,

This discussion area only for codeplex issues. It looks like your request would be better directed toward the specific project you are using. I encourage you to use the discussion service or issue tracker for the project you are interested in.
Marked as answer by kedavid on 12/23/2013 at 9:24 PM