hello,
i have this method index it takes data from list and pass the object to return view,
instead of sending data in return View(objadsbl) i want to send the return data in ViewBag.List- objadsbl
what should i change in my view ? so it can get data from viewbag instead of return view()
IList<AdsBO> objadsbl = new List<AdsBO>();
objadsbl = adsbl.getadsbl(authodid);
return View(objadsbl);
here is my view
@model IEnumerable<BusinessObjects.AdsBO>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>@Html.DisplayNameFor(model => model.Heading)</th>
<th>@Html.DisplayNameFor(model => model.Created)</th>
<th>@Html.DisplayNameFor(model => model.Modified)</th>
<th>@Html.DisplayNameFor(model => model.Status)</th>
<th>@Html.DisplayNameFor(model => model.Condition)</th>
<th>@Html.DisplayNameFor(model => model.Price)</th>
<th>@Html.DisplayNameFor(model => model.Original_Price)</th>
<th>@Html.DisplayNameFor(model => model.Visits)</th>
<th>@Html.DisplayNameFor(model => model.Replies)</th>
<th>@Html.DisplayNameFor(model => model.LastActivity)</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>@Html.DisplayFor(modelItem => item.Heading)</td>
<td>@Html.DisplayFor(modelItem => item.Created)</td>
<td>@Html.DisplayFor(modelItem => item.Modified)</td>
<td>@Html.DisplayFor(modelItem => item.Status)</td>
<td>@Html.DisplayFor(modelItem => item.Condition)</td>
<td>@Html.DisplayFor(modelItem => item.Price)</td>
<td>@Html.DisplayFor(modelItem => item.Original_Price)</td>
<td>@Html.DisplayFor(modelItem => item.Visits)</td>
<td>@Html.DisplayFor(modelItem => item.Replies)</td>
<td>@Html.DisplayFor(modelItem => item.LastActivity)</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Detalje", "Ads", "Detail", new { id = item.ID }, new { @class = "red-c bold upp padding10"}) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
</td>
</tr>
}
</table>