Problem with ajax method and parameters..
Problem with ajax method and parameters..
I have a datatabe with the following ...
...
"ajax": {
"url": "/ MyController / MyAction? ag77_clv_ubics =" + $ .trim ($ ('# Tb_XXX'). val ()),
...
...
...
Where Tb_XXX is an Input.
The first time I open the dtatable it receives the correct parameter in MyAction
public ActionResult MyAction (string ag77_clv_ubic) --------> The first value typed in the input is always received
.
..
But if I close the datatable and change the value of the input "Tb_XXX" and invoke the datatable / ajax again, then MyAction always receives the first value I send in the input, even if the value of the input changes.
I need the above to filter a datatble based on the value typed in the Tb_XXX inpu.
Please help...
Work with MVC
Answers
You are initializing the
ajax
url with the value of that varaible. It won't change. Use theajax.data
option as a function for the ability to change the value sent in the parameters.Kevin