jaydeep shah

jaydeep shah

  • NA
  • 44
  • 3.7k

how to execute query on button click in mvc5

Oct 5 2015 5:27 AM
i have some images  
image name  plazma 90 , plazma 120 , plazma 160    => directitemid 
and i have to execute query catagory vise    
catagory like = rowitem,casting,hardware 
 

PLASMA 60

PLASMA 90

PLASMA 120 

PLASMA 150

 
 
 
i write query ..
 
 RowItemcontroller.cshtml
 
public ActionResult ifcondi()
{
var data1 = (from c in db.RowItems
join a in db.categories on c.CategoryItemId equals a.category_id
join d in db.DirectItems on c.DirectItemId equals d.Id
where d.ItemName == "PLASMA 60"                                         // how can i pass parameter here ...
select new { c, a, d }).GroupBy(x => x.a.category_name).Select(y => new tempdata
{
CatagoryName = y.Key,
lists = y.Select(p => new a
{
name = p.c.ItemName
}).ToList()
}).ToList();
return View(data1.ToList());
}
and i get result but i want to get result from image click .. so what can i add ????
 
 index2.cshtml
 
image code
<tr>
<td>
<div class="col-md-3" style="border-style: groove; border-width: 2px; border-color: #3c8dbc; border-radius:10px;">
<div class="col-md-6">
<div class="list-group">
<h2 style="padding:0px; margin:0px;"><a href="#" class="text-center" style="padding:0px; margin:0px;">@Html.DisplayFor(modelItem => item.ItemName)</a></h2>
</div>
</div>
</div>
</td>
</tr>
 
 
 
 
 
 

Answers (2)