I´m making searchbox to get one register of my database depending of value sended, so in my view:
<p> Manifest: <input type="text" name="manifest" id="manifest" /> <input type="submit" value="search" name="btnGetForEdith" id="btnGetForEdith" /></p>
JS:
$(document).ready(function () {
GetModulLogWasteForEdit();
$("#btnGetForEdith").click(onGetModulLogWasteSuccess);
});
function GetModulLogWasteForEdit() {
currentId = 0;
try {
$(function () {
$.ajax({
cache: false,
type: "get",
dataType: "json",
url: "/LogWaste/GetForEdit",
contentType: "application/json; charset=utf-8",
success: onGetModulLogWasteSuccess,
error: function (response) {
ErrorMessage("Error", GetTextError(response));
}
});
});
} catch (e) {
ErrorMessage("Error", e.message);
}
}
Controller:
public ActionResult GetForEdit(string manifest)
{
string result = string.Empty;
var userId = User.Identity.GetUserId();
var currentUser = UserClass.GetUserBranchOfficeId(userId);
try
{
result = new JavaScriptSerializer().Serialize(LogWasteModule.GetForEdit(currentUser));
}
catch (Exception)
{
throw;
}
return Content(result, "application/json");
}
Problem is I don´t getting "manifest" value into my controller it come null
so I can´t play with it. Can anyone explain me why it happens? Regards