This is a migrated thread and some comments may be shown as answers.
Grid Ajax Select with HTML input parameters
1 Answer 34 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
javier
Top achievements
Rank 1
javier asked on 29 May 2012, 10:47 AM
Hello,

I need to pass parameters to the Select method but all parameters must be taken from HTML elements.
I need to do domething like:
                .DataBinding(dataBinding => dataBinding.Ajax()
                            .Select("MyAction", "MyController",
                                    new {
                                          PropertyOne =  "<#= aCheckboxInput.checked #>",
                                          PropertyTwo = "<#= $('#aTextInput').val()  #>"
                                    })
The PropertyOne gets the rigth value but the property does not, so when the grid data binds get this error:
HTTP Error 400 - Bad Request.
I also tried to acces directly (without JQuery) to the text input but I get the same error. I mean, something like:                .DataBinding    (dataBinding => dataBinding.Ajax()
                                 .Select("MyAction", "MyController",
                                     new {
                                         PropertyOne = "<#= aCheckboxInput.checked #>",
                                         PropertyTwo = "<#= aTextInput'.value #>"
                                     })
For some reason, all Telerik's samples don't mention a way to do this.

Thank you,

1 Answer, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 02 Nov 2012, 05:02 PM
I have the same need. Any ideas peoples? The values I need to pass are not in the the model. They are in a partial view model. 
Tags
Grid
Asked by
javier
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or