2012-05-06 13 views

Respuesta

47

sin utilizando jQuery, asumiendo que usted está en un bucle foreach como algo más adelante, solo cambia la definición tr a ser algo así como:

@foreach (var user in Model.Users) 
{ 
    <tr onclick="location.href = '@(Url.Action("ShowProfile", "Users", new { userId = user.UserId }))'"> 
    //rest of your markup for that table row 
    </tr> 
} 
+0

no hacer nada. ¿Me puedes ayudar? –

+1

Doh, perdí el 'location.href =' antes. Prueba mi edición, debería funcionar para ti ahora. – mattytommo

+0

Excelente respuesta. Funciona maravillosamente – EvilDr