0
I created a database entity and a dropdownlist. When I click on a list item, I want to call the other data. How do I ??
Follows code
public ActionResult dbExample()
{
copaDBEntities entity = new copaDBEntities();
var getCopaList = entity.copa.ToList();
SelectList list = new SelectList(getCopaList, "id", "ano");
ViewBag.copalistano = list;
return View();
}
}
js
<script type="text/javascript">
$("#CopaList").change(function () {
$("#msg").text("A copa de " + $("#CopaList option:selected").text() + " teve como país(es) sede(s) : " +
+ "O Campeão foi " + + "O Vice Campeão foi " +
)
})
image
How so "call the other data", can explain better?
– Ricardo Pontual
in code c# only shows the year. I want to show the headquarters, the champion and the vice this year.
– bcastro1995
You will need to make a request to c# to get the rest of the data.
– Maycon F. Castro