Maybe what I want to do may be impossible, due to server and browser side issues, but I'd like to do the following:
<script>
function pegarId(id) {
$('@ViewBag.Id').value = $(this).attr("id");
}
</script>
Thank you in advance for any tip or help.