I have implemented a module using Angular Js and TypeScript in DotNetNuke7 where i have implemented my all Input Forms and js in a web project named as customerNew and than added a Web APi into a another project named as CustomerNewController which is having my methods but when i hit the URL from my Web Project to Api.It doesn't processed.I have implemented a route mapper as well but still not able get success.
My Route Mapper Class is Given Below:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotNetNuke.Web.Api;
using System.Web.UI.WebControls;
namespace CustomerNewController
{
class RouteMapper : IServiceRouteMapper
{
public void RegisterRoutes(IMapRoute mapRouteManager)
{
mapRouteManager.MapHttpRoute("CustomerNewController", "default", "{controller}/{action}",
new[] { "CustomerNewController" });
}
}
}
Here is my WebApi
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Collections;
using System.Web.UI;
using System.Xml.Serialization;
using DotNetNuke.Entities.Users;
using System.Web.Services;
using DotNetNuke.Web.Api;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules.Communications;
using DotNetNuke.Entities.Modules;
namespace CustomerNewController
{
public class CreateController : DnnApiController
{
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage HelloWorld()
{
return Request.CreateResponse(HttpStatusCode.OK, "Hello World!");
}
}}
My URL
http://localhost/dnn7/DesktopModules/CustomerNewController/Api/Create/HelloWorld
Here is my folder structure