When I am sending data (a string value) to my ASP.Net MVC controller the data is sent successfully. When I send special characters, like . and &, it shows an error like this:
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly)
Why does this happen? I can't find a solution for this. Please help me to resolve this problem.
$(function() {
var link = '@Url.Action("Index", "Home", new {id= "_Description_"})';
$('#btnSaveComments').click(function() {
var description = $('#descr').val();
$('#btnSaveComments').attr('href', link.replace('_Description_', description));
});
});
@Html.TextAreaFor(model => model.Description, new { id = "descr" })
<button type="submit" text="submit" id="btnSaveComments" />
public ActionResult Index(string id)
{
return view();
}