I have an error in MVC, when I pass as parameter '&' fails to come the following. How will I show in this example?
public IActionResult Create(int? idTrabalhador, [FromQuery]string GridState{}
view
var lnk = "@Url.Action("Create" , new { idTrabalhador = "{#KeyTrabalhador}", GridState = "{#GRID_STATE}" })";
lnk = lnk.replace(encodeURIComponent("{#KeyTrabalhador}"), 0);
lnk = lnk.replace(encodeURIComponent("{#GRID_STATE}"), JSON.stringify(state));
http://localhost:58185/TrabalhadorPincodes/Create?idTrabalhador=0&GridState={"filter":{"NomeTrabalhador":"nuno","Estado":"0"},"sorter":[],"currentPage":0}
model => GridState = "{\"filter\":{\"NomeTrabalhador\":\"nuno\",\"Estado\":\"0\"},\"sorter\":[],\"currentPage\":0}"
Perfect!!!
BUT
http://localhost:58185/TrabalhadorPincodes/Create?idTrabalhador=0&GridState={"filter":{"NomeTrabalhador":"&","Estado":"0"},"sorter":[],"currentPage":0}
model => GridState = "{\"filter\":{\"NomeTrabalhador\":\""
need help!!!