Win8 ASP.net HttpRouteUrl

Axed123

New Member
I am pretty new to Win8 and ASP.net development, I apologize for any lack of clarity or specification as I am a 3D graphics programmer by trade and taking on developing an ASP.net back end system. The goal is communicate with a target Win8 app to consume data that is input via the ASP.net website by a user(admin).I am hitting multiple hurdles and dead ends with it being new Win8 technologies and few sound reference materials.Within HomeController.cs I am attempting to call:\[code\] public ActionResult Admin() { string apiUri = Url.HttpRouteUrl("DefaultApi", new { controller = "testModel", }); ViewBag.ApiUrl = new Uri(Request.Url, apiUri).AbsoluteUri.ToString(); return View(); }\[/code\]So that I can enable routing to my Admin controller. However I get the following output in the browser:http://i.imgur.com/WX34S.pngI am using an example project I downloaded from the internet as a skeleton framework as it contains the WebApiConfig.cs file, whereas generating a new VS2012 ASP.NET MVC Web Application project does not contain this file and I believe I need it as it is the point I am able to specify that I want to serialize as JSON and remove XML formatting.I have cleaned out .DLL files in bin and cleaned the obj folder in case it was referencing an object that no longer exists.There are several other projects that I have created, one that uses the VS2012 MVC Web app project generated from the wizard, it implements:\[code\] Url.RouteUrl\[/code\]instead of\[code\] Url.HttpRouteUrl\[/code\]But I am sure this does not achieve the same effect, as I want to communicate http over the internet from a server to the target app. If I try to use latter, it errors:\[code\] 'System.Web.Mvc.UrlHelper' does not contain a definition for 'HttpRouteUrl' and no extension method 'HttpRouteUrl' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)\[/code\]As reference, this is the article I am using to assist this portion of the project:http://www.asp.net/web-api/overview...k/using-web-api-with-entity-framework,-part-4I appreciate the help(this is very different from OpenGl and DirectX)
 
Back
Top