PHP's $a[] array in ASP.NET/C#

Last post 11-23-2006 11:58 PM by Kiryn. 1 replies.

Sort Posts:

  • PHP's $a[] array in ASP.NET/C#

    11-08-2006, 11:40 AM
    • Member
      10 point Member
    • temuri
    • Member since 11-08-2006, 3:25 PM
    • Posts 2

    Hi all, could anyone tell me the following. How do I create in ASP.NET/C# analogue of the following in HTML/PHP:

    <form> 

    <input type="checkbox" name="items[]" value="1" />

    <input type="checkbox" name="items[]" value="2" />

    <input type="submit /"> 

    </form>

    then, on the receiving side an $items *array* is created consisting of 1 and 2.

    How do I do the same using ASP.NET and how to catch that array on the server side using C#?

    Thank you in advance,

    Temuri 

  • Re: PHP's $a[] array in ASP.NET/C#

    11-23-2006, 11:58 PM
    • Member
      175 point Member
    • Kiryn
    • Member since 07-04-2006, 11:26 AM
    • Posts 35

    like to convert for example. $a = array("i" => true, "p" => false)

    do

    Dictionary<string, bool> a = new Dictionary<string, bool>();

    a.Add("i", true);

    a.Add("p", false);

    to get the items just do a["p"]; Big Smile there you go on converting the arrays part. 

    Filed under:
Page 1 of 1 (2 items)