Pass multiple parameters from AngularJS to ASP.Net MVC controller

Last Reply on May 12, 2015 03:53 AM By Mudassar

Posted on May 12, 2015 03:53 AM

In my scenario I wanna pass two parameters (Array,string) to API controller POST method, How can I determine resource and setCode for passing two parameter?

Resource:

    app.factory("EthnicCodeResource", ['$resource', function ($resource) {
    return {
    Codes: $resource('api/Code/:collection', { collection: '@collection' }, { postCollection: { method: 'POST', isArray: true } }),
    Effects: $resource('api/Effects:reviewSetCode', { reviewSetCode: '@reviewSetCode' }, { setCode: { method: 'POST', isArray: true } }),
    HCodes: $resource('api/HCodes')
    } + +
    Save:

    EthnicCodeResource.Effects.setCode($rootScope.myData).$promise.then
    (function() {

                });

    +
    API Controller:
    [HttpPost]
    public void Post(List reviewSetCode)
    {
    // +
    } + +In my scenario I wanna pass two parameters (Array,string)to API controller POST method, +like, [HttpPost]
    public void Post(List reviewSetCode, string act)
    {
    // +
    }. +


In my scenario I wanna pass two parameters (Array,string) to API controller POST method, How can I determine resource and setCode for passing two parameter?

Posted on May 12, 2015 03:53 AM

Refer

http://www.dotnetcurry.com/showarticle.aspx?ID=1002

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html