Hi,
Our retirement is, we need a search functionality and bind the data(Model binding) in to the table in our cshtml page.The process should through
$ajax post method.
We tried to Implement according to the above requirements,As a result we could bind the model data in to our chtml page(While checking with Breakpoint we can make sure that data is binding into to each td).But the problem is ,The table are not displaying after binding the data
below is our controller
[HttpPost]
public ActionResult Edit_cradholders(string fName,string surName, string cardHolderRef, string token, string cardHolderStatus)
{
try
{
var id = (FormsIdentity)User.Identity;
using (var db = new Entitityframework().Crunch_get_cardholder(0, fName, surName, cardHolderRef,token, cardHolderStatus, 0, 0, 0, "", "", 0, "", "")
{
return View(db.ToList());
}
}
catch (Exception)
{
return View();
}
}
Here is our view potion(just added only requirement potion)
@model IEnumerable<mvc3_crunch.models.crunch_get_cardholder_result>
<table id="SearchResult1" class="table table-striped table-bordered table-condensed mGrid">
<thead>
<tr>
<th>
System reference
</th>
<th>
Reference
</th>
----
</tr>
</thead>
<tbody>
@{
int i = 0;
if (Model != null)
{
foreach (var m in Model)
{
<tr>
<td>
<div class="control-group">
<div class="controls">
<div class="input-prepend">
<label>
@m.Reference</label>
</div>
</div>
</td>
------------
}
}
</tr> </table>
Please help on this,
Thanks & Regards,
Soumya