一个简单html form:- <form name="myform">
- <table>
- <tr>
- <td><input name="product[]" value="11"></td>
- <td><input name="price[]" value="22"></td>
- </tr>
- <tr>
- <td><input name="product[]" value="33"></td>
- <td><input name="price[]" value="44"></td>
- </tr>
- <tr>
- <td><input name="product[]" value="55"></td>
- <td><input name="price[]" value="66"></td>
- </tr>
- </table>
- <input type="submit">
- </form>
复制代码 在PHP, 我们可以直接retrieve product and price as array。也就是说formdata processing时我们可以这样:- <?php
- for($i = 0; $i < count($_REQUEST['product']); $i++)
- {
- echo "The price of product " . $_REQUEST['product'][$i] . " is " . $_REQUEST['price'][$i] . PHP_EOL;
- }
- ?>
复制代码 Output:- The price of product 11 is 22
- The price of product 33 is 44
- The price of product 55 is 66
复制代码 请问asp.net c# 应该怎么做? 看了一下<asp:textbox> 好像行不通。。。
![](static/image/smiley/emot/emot/em03.gif) |