I'm working on mvc4 web api project.
I have created a new controller GroupValuesController and i have following methods
public GroupViewModel Get()
public List<GroupModel> Get(Guid Id)
public List<GroupModel> GetDetails(Guid Id)
First two methods are working fine I'm calling them from a group.cshtml view like following
$.getJSON(
"api/groupvalues",
function (data) {
and
$.getJSON(
"api/groupvalues/" + id,
function (data) {
For third controller method public List<GroupModel> GetDetails(Guid Id) i'm executing that from Details.cshtml view like following but it is not working.
i'm mismatching some calling ?
function getGroupDataById(id, ctrl) {
$.getJSON(
"api/groupvalues/GetDetails/" + id,
function (data) {
Is this related with Route?
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
404 error