开发者

help with 2d array form in asp.net mvc

开发者 https://www.devze.com 2022-12-08 09:52 出处:网络
http://www.plus2net.com/php_tutorial/array_checkbox.php the link is my reference in PHP i want to ask how can i archive the samething with 2d array of data in asp.net mvc. if posible please show me

http://www.plus2net.com/php_tutorial/array_checkbox.php

the link is my reference in PHP

i want to ask how can i archive the samething with 2d array of data in asp.net mvc. if posible please show me some example, i can't find any info. I remember that php did this very easy. or even in ruby on rails.

开发者_运维问答

elementname[][]

thank you


If you have a bunch of checkboxes with the same name:

<input type="checkbox" name="box" value="Freddy" />
<input type="checkbox" name="box" value="Brian" />
<input type="checkbox" name="box" value="John" />
<input type="checkbox" name="box" value="Roger" />

You just do this to get the checked values:

string[] values = Request.QueryString.GetValues("box");
0

精彩评论

暂无评论...
验证码 换一张
取 消