Hi. I have an MVC3 application programmed in VB.NET.
In this MVC3 application, I have a controller. The controller's JSON action has 3 parameters as specified below:
Function JSONRetrieveDocuments(
ByVal contactId As Guid,
ByVal includeLoanBasedDocuments As Boolean,
<DataSourceRequest()> request As DataSourceRequest) As ActionResult
As part of a Grid, I build a route value dictionary as part of the function that creates the CrudOperationBuilder:
Public Function CreateCrudOperationBuilder(cob As Kendo.Mvc.UI.Fluent.CrudOperationBuilder) As Kendo.Mvc.UI.Fluent.CrudOperationBuilder
Dim theRouteValueDictionary As New RouteValueDictionary()
theRouteValueDictionary.Add("contactId", Request.QueryString("contactId")) 'theRouteValueDictionary.Add("includeLoanBasedDocuments", ???
Return cob.Action("JSONRetrieveDocuments", "ContactBasedDocument", theRouteValueDictionary)
End Function
When making the call to JSONRetrieveDocuments, I want to be able to populate the includeLoanBasedDocuments parameter of the controller's action by simply returning the checked status of a checkbox... so I created this javascript function:
function ShouldIncludeLoanBasedDocuments() {
return $("#cbIncludeLoanBasedDocuments")[0].checked;
}
I'm curious
a) how do I supply the result of the javascript function to the route values?
b) am I following best practices on this one? It seems like this would be a common operation, but I couldn't find any documentation on it.
Thanks,
Jason