-1

I am facing an issue.

I have a string value that i pass to web api controller.

If i pass "myValue" , it received as as "myValue" in controller but if i pass "&&myValue" than it is received as null.

Any idea about it?

Code:

Web Client

factory.downloadStrudentReport = function(date, Name) {
    $rootScope.$broadcast('dowload', _url + 'GetStudentPdfReport', { date: date, Nanme: Name});
};

Server

[HttpGet]
[Route("GetStudentPdfReport")]
public HttpResponseMessage GetStudentPdfReport(DateTime date, string stuName)
}

 //////////////
{

Another post, Passing json data to a WebApi with special characters results to null

says, client.Encoding = Encoding.UTF8; but not sure where? Any idea?

Community
  • 1
  • 1
simbada
  • 940
  • 4
  • 24
  • 43

1 Answers1

0

Use the encodeURIComponent function to encode the values.

Anwar Javed
  • 325
  • 3
  • 11