I am trying to post whole form data by ajax. My sample code is here:
$.ajax({
url: "@Url.Action("SaveTPGeneralInfo", "Techpack", new { area = "OMS" })",
data: $('#FormId').serializeArray(),
type: 'POST',
success: function (data) {
if (data) {
// .....
}
},
error: function (error) {
// .....
}
});
As I am working in asp.net mvc 4, I am catching the data like this:
public int SaveTPGeneralInfo(oms_techpack oms_techpack)
{
try
{
return 1;
}
catch (Exception ex)
{
return 0;
}
}
Here some data contains special characters (like &, @). Those characters are passed as encrypted(like for '&' it passes 'amp;'). How can I get the original data that contains special characters. Need help...
I create 2 methods that I run the result through to get back the original.
you can pass the string you want converted to one of these and you should get what you want.