>
>Can you please show a sample of the client side redirect? Also, how will it get the model I am passing?
I tend to just use something like this:
document.location = "urlgoeshere";
You don't really pass the model directly. What I do is embed the primary key in a hidden column of the grid. When the grid loads, I check the record count. If it's 1 I grab this hidden column and include it in my redirect.
Here's some code from one of my projects. I'm using jqGrid so you won't be able to use it as-is, but hopefully it helps point you in the right direction:
Basically what happens is the grid requests data via JSON (not shown). Once it has retrieved that data it calls gridLoadComplete and passes in the data it received. I select the first row. Another jqGrid event fires when the row is selected that calls selectLoan and it passes in the primary key I set in gridLoadComplete. I have a settings object that holds my settings and URLs so I take that URL and add in the ID (so the URL ends up being something like /Controller/Action/Edit/1)
Most of this code is just eventing stuff specific to jqGrid.
var settings = {
viewLoanUrl: "@Url.Content("~/Loan/Detail/")";
};
function selectLoan(id, selected) {
document.location = settings.viewLoanUrl + id;
}
function gridLoadComplete(data) {
if (data.records == "1") {
var items = $("#loan").jqGrid("getRowData");
$("#loan").jqGrid("setSelection", items[0].Loan);
}
}