This is a migrated thread and some comments may be shown as answers.

How can I pass default parameters to Ajax().Insert() ?

2 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vladimir
Top achievements
Rank 2
Vladimir asked on 14 Jul 2011, 11:40 AM
Hello.
I'm using the following code to pass parameter in Insert() command:
.DataBinding(dataBinding => dataBinding.Ajax()
                            .Select("Select", "ControllerName", new { Id = "<#= Id #>" })
                            .Insert("Insert", "ControllerName", new { Id = "<#= Id #>" })
                            .Update("Update", "ControllerName"))

Is there any way to get passed value in [HttpPost] Insert() Action? For now it is always = 0. Select action is Ok.

It seems, the only solution is here

2 Answers, 1 is accepted

Sort by
0
StevenDale
Top achievements
Rank 2
answered on 21 Mar 2012, 03:28 PM
I know this is almost a year later after the original question but does anyone have an answer to this?
0
Dadv
Top achievements
Rank 1
answered on 21 Mar 2012, 06:06 PM
Hi,
I'm not really sure of what you want, do you want to pass a datakey in all the databinding (select, insert, update)? if yes look at this.


.DataKeys(keys =>
       
{
            keys
.Add(p => p.Id).RouteKey("Id");
       
})
.DataBinding(dataBinding => dataBinding.Ajax()
                            .Select("Select""ControllerName")
                            .Insert("Insert""ControllerName")
                            .Update("Update""ControllerName"))

Tags
Grid
Asked by
Vladimir
Top achievements
Rank 2
Answers by
StevenDale
Top achievements
Rank 2
Dadv
Top achievements
Rank 1
Share this question
or