In the site I'm doing, there's a need to click on a row of the table it redirects to another page, but the row's id's are dynamic because each row should redirect to a page that shows more information.
My View:
@foreach (projeto1.Entidade.PessoaEntidade item in Model)
{
<tr id="[email protected]">
<td id="[email protected]" style="width:10%">
@item.id
</td>
<td style="width:40%">
@item.Nome
</td>
<td style="width:40%">
@item.Sobrenome
</td>
<td style="width:10%">
<input type="button" value="Alterar" id="partionalViewUpdate" onclick="Teste(@item.id)" />
</td>
</tr>
My Script:
$(document).ready(function () {
$("tr").click(function () {
alert("Clicado");
});
});