Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
See more:
here
HTML
@foreach (var item in Model)
              {
                  <tr>
                    
                      <td>
                          <a href="#"></a>
                      </td>

but i dont want to use a button rather i want to click each row and new page will open

What I have tried:

HTML
@foreach (var item in Model)
              {
                  <tr>
                    
                      <td>
                          <a href="#"></a>
                      </td></tr></tr>
Posted
Updated 19-Apr-16 7:10am
v2
Comments
Sinisa Hajnal 19-Apr-16 3:11am    
Add click handlers on row or td clicks and select the row by adding css class that selects the row and/or attribute that denotes the selected row.
Where is the issue? You can easily attach any type of events with the td.

1 solution

Try this...

JavaScript
$("#tableId tr").click(function() {
   window.document.location = "http://www.yourwebsiteurl.com/newpage.html";
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900