Tuesday 8 May 2018

Params keyword in Array C#

\\using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace ConsoleApplication9

{

    class Program

    {



        public void show(params int []a)

        {

            for (int i = 0; i < a.Length; i++)

            {

                Console.WriteLine(a[i]);

            }



        }



        public void showobjects(params object[]a )

        {

            foreach (var item in a)

            {

                Console.WriteLine(item);

            }



        }

        static void Main(string[] args)

        {



            Program p = new Program();

           // p.show(1, 2, 3, 4,7);

            p.showobjects("ali", 1, "salman", 'c', 3.142);

            Console.ReadLine();

        }

    }

}


Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...