0
Maybe what I want to do may be impossible, because of server and browser side issues, but I would like to do the following:
<script>
function pegarId(id) {
$('@ViewBag.Id').value = $(this).attr("id");
}
</script>
Thanks in advance, any hint or help.
Can’t do that. To communicate between browser and server you have to use http requests (or Formulary submissions, or AJAX requests).
– Rui
You want to select the element according to what is stored in
ViewBag
, or wants to assign a value toViewBag.Id
?– RSinohara
Could you give more details than you want to do? It got a little confused what you’re asking for.
– Luã Govinda Mendes Souza
@Lucas tries to edit your question and describe a little better your purpose, that maybe we can help you with a better solution to your problem.
– Richard Dias
Could you tell us what scenario you are trying to use? It would be easier to find a better solution to help you.
– Leonardo Coelho