How can I select a record in a Grid and then post that record to an action in another controller
This is the architecture:
SearchController retrieves data and fills a Telerik grid. Rows are selectable in the grid. When a row is selected, I want to access the DataKey (AccountId) and pass that key to an action in EchoController.
On the grid I'm using:
.ClientEvents(events => events.OnRowSelected("onRowSelected"))
The javascript looks like this:
function onRowSelected(e) {
var AccountId = e.row.cells[0].innerHTML;
alert(AccountId);
$.ajax({ type: "POST",
url: "/Echo/GetPatientData",
datatype: "json",
traditional: true,
data: AccountId,
dat开发者_JAVA技巧a: { 'AccountId': AccountId }
});
}
The post does work, however, I'm not able to display the SearchResults view in the Echo controller. This strategy obviously is flawed.
Question: What is the right way to accomplish this?
Thanks!
Arnold
I have moved on from this question. I'm doing things differently. Thanks to any who looked into this. -Arnold
精彩评论