User185633436 posted
I have written a Blazor Server Web application.
I generate a table with rows and columns and each cell I draw an image based on a records state using the code below.
<table id="status">
<tr>
<th width="200px">Status.</th>
@for ( int i = 1 ; i <= LastStep ; i++ )
{
<th>Record @i</th>
}
</tr>
@if ( Records != null )
{
@foreach( var rec in Records )
{
<tr>
<td width="200px">
@rec.Status
</td>
@for( int j = 1 ; j <= LastStep ; j++ )
{
<td>
<img src="@ImageSourceForStep( rec.Id, j )" @onclick="( () => OnImageClick())"/>
</td>
}
</tr>
}
}
</table>
I have an OnImageClick method in the code-behind that gets called when the user clicks on one of the images.
The problem I have is in the click handler determining which of the images was clicked.
Can someone help explain to me how I can identify the image to the click handler?
Best Regards
Andy