prabhu p

prabhu p

  • NA
  • 181
  • 110.3k

how to pass class and string in ajax call and pass to action

May 17 2020 9:30 AM
Hi Friends,
 
I am facing an issue one of development and i tried few but no result so please help on this
 
my thing is i am passing model(class name AUVmodel) and string from MVC in Ajax call 
 
but when iam trying to pass any one of the two(AUVmodel or string ) iam getting in controller(parameter class obj )
 
or controller(parameter string strname)  working fine
but controller (parameter class, parameter string ) iam getting error.
 
I want to know how to pass class and string in ajax call and pass to controller (parameter class, parameter string ) respectively
 
var formFields = "";
formFields = JSON.stringify(AUVModels); // model
$.ajax({
url: actionUrlToDownloadPAPDocument,
data: { AUVModel:formFields, __RequestVerificationToken:antiForgeryToken},
contentType: "application/json; charset=utf-8",
async: false,
type: 'POST',
success: function (response) {
}
});
 

Answers (1)