In PHP I can define and use a function like this:
<html>
<head></head>
<body>
<?php
function processItem($item)
{
$item = $item * 10;
?>
The item is <strong><?= $item ?></strong><br />
<?php
}
?>
<?php
$items = array(1,2,3,4);
for($i = 0; $i < $items.length; $i++)
{
processItem($items[$i]);
}
?>
</body>
</html>
If I try to do the same thing in C#, using the <% %>
syntax, it will always throw an error. It doesn't like having the extra text/html showing up in the function.
Can someone show me how to write the above example in C#? I am unable to find the terms that will yield a result in Google