forum

Home / DeveloperSection / Forums / Return List to ajax mvc3

Return List to ajax mvc3

Anonymous User 2611 03-Dec-2014

I am working on MVC3 and following is my controller 

  public List<int> ddlTransType_Change(int DocID)
        { 
            return UserDocumentServive.getSelectedUsers(DocID); 
        }

My Ajax 

  $.ajax({
                type: 'GET',
                url:"/MIS.MVC/" + "DocumentApproval/ddlTransType_Change",
                data: {
                    'DocID': $("#ddlTransType").val().trim()
                },
                success: function (result) {
                    alert(result.value)
},
error: function (e) {
                    alert("Error:Unable to load data from server");
                }
            });

Controller returns a list of int values i.e {1,74,23,1} and I want to show them in alert. any idea how to do it .?


Updated on 04-Dec-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By