0

I have MVC3 asp.net project. I create controller function with some parameters, the question is how can I pass the value from Textbox to Jqgrid?

I want to something like:

jQuery("#list1").jqGrid({
        url: '@url.content("~/")MyController/MyFunction?Parameter1=valueFromTextBox'
...

I tried to insert with

$("#TextBox").attr("value")

but it doesn't work any have idea?

thanks

vantian

vantian
  • 848
  • 3
  • 10
  • 25

1 Answers1

0

You should better use postData parameter having function (method):

$("#list1").jqGrid({
    url: '<%= Url.Content("~/MyController/MyFunction") %>',
    postData: {
        Parameter1: function() { return $("#TextBox").val(); }
    },
    ...
});

See here for details.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798