1

I load the content of a Kendo Window with a call to a Controller Action that returns a partial view. This action accepts one parameter (levelid). I'd like to supply this parameter with javascript similar to the below but this is causing me an error. Is it possible to do this?

 @(Html.Kendo().Window().Name("AssetLocator")
        .Title("Asset Locator")
        .Visible(false)
        .Modal(true)
        .Draggable(true)
        .Width(350)
        .LoadContentFrom("_LaunchAssetLocator", "Form707B", new { levelid = getsite(); })
       )
mgh75
  • 77
  • 3
  • 11

1 Answers1

1

There are a few ways to do this. The data source allows you to specify data in the form of a JS function. I could not find a similar function that would be in the form of:

LoadContentFrom().Data("jsFunctionToGetData");

To get around this you can configure your grid in Razor and then grab a handle to the grid in Jquery load and implement the refresh, supplying your own parameters. See the second answer in the link below:

how to set LoadContentFrom kendo window in run time

Another way to supply your parameters client side is detailed in the answer below, simply override the open method:

MVC kendo window - Get Data from javascript function

Ross Bush
  • 14,648
  • 2
  • 32
  • 55