Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9244215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:58:25+00:00 2026-06-18T08:58:25+00:00

I know in PHP we can easily create something like this to handle HTML

  • 0

I know in PHP we can easily create something like this to handle HTML array elements:

<input name="test[0]" value="1" />
<input name="test[1]" value="2" />
<input name="test[2]" value="3" />

Then in code I can access this as an array:

$arrElements = $_POST['test'];
echo $arrElements[0]; // prints: 1

I have been trying to do the same in ASP.NET (Web Applications). But unfortunately this (also) doesn’t work that easy.

So if i use the same HTML as above, i then tried to do the following in my CodeBehind:

var test = Request.Form.GetValues("test");

But this results in test being null. Is there anyway to handle HTML array elements like i can with PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:58:27+00:00Added an answer on June 18, 2026 at 8:58 am

    Change your html :

    <input name="test" value="1" />
    <input name="test" value="2" />
    <input name="test" value="3" />
    

    code behind :

    var test = Request.Form.GetValues("test");
    

    And now you will get array of values in test var.

    If you can’t change html you can use this code :

    var testList = new List<string>();
    foreach (string key in Request.Form.AllKeys)
    {
        if (key.StartsWith("test[") && key.EndsWith("]"))
        {
            testList.Add(Request.Form[key]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how to create a php function that can be
I know I'm able to this in PHP, but I can't remember the name
Can we get variable name('PHPSESSID') defined php.ini through some function in PHP? I know
In javascript you can easily create objects and Arrays like so: var aObject =
I know PHP 5 already supports SQLite but for some reason I can't get
How can i know if PHP server is installed on my pc ? and
I know in C++ and in PHP you can fill a string or a
I want to know that whether on a php page we can get browser
Possible Duplicate: how to upload folder with php I know we can upload single
As far as I know, Drupal Services Module can allow PHP scripts to communicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.