Nov 15, 2012, 9:28 PM
[MVC] How to call function in controller, from ImageCommandColumn in view?
I have a GridPanel, where one column has clickable icons. When a user clicks on one of these icons in some row, I want to call a function in my controller.
In Views/Home/Index.cshtml, I have this:
In Views/Home/Index.cshtml, I have this:
columnModel.Add(Html.X().ImageCommandColumn()
.Commands(command => {
command.Add(Html.X().ImageCommand()
.CommandName("DoStuff")
})
);
And I want to call this, in Controllers/HomeController.cs:public void DoStuff()
{...}
How do I do this?