I am writing code in ASP.NET and I am new at it. I have two arrays, one of names and the other of ids.
I want to create a table that would have the names in one column and two links which depend on the ids in the other column (edit to this specific name link, delete to this specific name link).
In PHP I would do it this way:
<table>
<tr>
<td>Title</td>
<td>Actions</td>
</tr>
<?php
$names = Array("a", "b", "c");
$ids = Array("1", "2", "3");
for($i = 0; $i < 3; $i++):
?>
<tr>
<td>
<?php echo $names[$i]; ?>
</td>
<td>
<a href="edit.php?id=<?php echo $ids[$i]; ?>">Edit</a>
<a href="delete.php?id=<?php echo $ids[$i]; ?>">Delete</a>
</td>
</tr>
<?php endforeach; ?>
</table>
I understand that you can write something very similar in ASP.NET, but I have to use RadGrids. A huge thanks for help!
EDIT:
If it is important, I get the data as an XML, and I chose to parse it as 2 arrays. If it is easier, I can parse it differently.
RadGrids are an asp.net webforms control, you would normally bind the control to a datasource, and then change properties programatically in the code behind.