I am trying to call the function GetBreakDownLog when I change the LogYear. But After changing the year , the function is not called. Please can you help why the function is not called
Use the browsers debug tools to see if there are any syntax errors. Try a breakpoint in the called function, use the network tools to see the response to the Ajax call if made.
The value of txtYear is not POSTed to the /Employee/GetBreakDownLog action.
Are you sure the onchange event is not firing? Are you using dev tools to verify the GetBreakDownLog() function is not called and the AJAX request does not happen? HAve you checked for error? Can you explain how you are testing?
I put the breakpoint in controller inside function GetBreakDownLog and the function is not called . I am passing txtYear from the model
This post is similar to your others where you simply do not debug your code. Why?
The code does NOT pass txtYear to the JavaScript! It passes whatever was in the model passed to the view which is not clear form your code. Please take a few moments to open the brower's dev tools (F12) and debug your code!
Member
411 Points
1327 Posts
the javasript function is not called, Please help
Sep 09, 2019 02:02 PM|polachan|LINK
I am trying to call the function GetBreakDownLog when I change the LogYear. But After changing the year , the function is not called. Please can you help why the function is not called
In Controller
public JsonResult GetBreakDownLog(BreakDownLogEntryModel report)
{
List<BreakDownLogEntryModel> BreakdownlogList = new List<BreakDownLogEntryModel>();
DataSet ds = ReportBLL.GetBreakDownLogForDepot(connectionSettings,
report.DepotNo, report.DepartmentID, report.LogYear, report.LogMonth
);
String jsonResult = JsonConvert.SerializeObject(BreakdownlogList);
return Json(BreakdownlogList);
}
All-Star
58254 Points
15675 Posts
Re: the javasript function is not called, Please help
Sep 09, 2019 02:58 PM|bruce (sqlwork.com)|LINK
All-Star
53091 Points
23659 Posts
Re: the javasript function is not called, Please help
Sep 09, 2019 03:01 PM|mgebhard|LINK
The value of txtYear is not POSTed to the /Employee/GetBreakDownLog action.
Are you sure the onchange event is not firing? Are you using dev tools to verify the GetBreakDownLog() function is not called and the AJAX request does not happen? HAve you checked for error? Can you explain how you are testing?
Member
411 Points
1327 Posts
Re: the javasript function is not called, Please help
Sep 09, 2019 03:29 PM|polachan|LINK
I put the breakpoint in controller inside function GetBreakDownLog and the function is not called . I am passing txtYear from the model
All-Star
53091 Points
23659 Posts
Re: the javasript function is not called, Please help
Sep 09, 2019 05:56 PM|mgebhard|LINK
This post is similar to your others where you simply do not debug your code. Why?
The code does NOT pass txtYear to the JavaScript! It passes whatever was in the model passed to the view which is not clear form your code. Please take a few moments to open the brower's dev tools (F12) and debug your code!
Member
411 Points
1327 Posts
Re: the javasript function is not called, Please help
Sep 09, 2019 09:21 PM|polachan|LINK
Many Thanks