Hello,
I am wondering how I can pass a model back to an action so that I can continue to work on the data but in a different action based on the button's pressed
To send it back, I specify the Control, Action and use the new { dom = Model } to specify the parameter.
dom is a List (so a list of domain objects. My model passed in is an IQuerable. When I make dom an IQuerable, I still receive nothing back from the view. here is the snippet, using telerik controls
VIEW
<% Html.Telerik().Grid(Model).Name("Domains")
.DataKeys(dataKeys => dataKeys.Add(c => c.DomainId)).DataKeys(dataKeys => dataKeys.Add(c => c.Timestamp))
.Columns(columns =>
{
columns.Template(o =>
{ %>
<%= Html.Encode(Html.OutputAction(ViewData["PerformActions"] as List<string>))%>
<%
}).Title("Action");
columns.Bound(o => o.DomainId);
columns.Bound(o => o.Name);
columns.Bound(o => o.SiteId);
columns.Bound(o => o.ScrubAndRedirect);
columns.Bound(o => o.ReportingSiteId);
columns.Bound(o => o.TrafficCopClass);
columns.Bound(o => o.SiteName);
columns.Bound(o => o.FeedType);
columns.Bound(o => o.Active);
}).Pageable().Sortable().Filterable().DataBinding(db => db.Server().Select("Domains", "Preview", new { doms = Model })).Render();%>
*ACTION*
public ActionResult Preview(List<Domain> doms)
{
return View("Preview", doms.AsQueryable<Domain>());
}
Thanks