Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8584341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:45:06+00:00 2026-06-11T21:45:06+00:00

I am pretty new to Win8 and ASP.net development, I apologize for any lack

  • 0

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:

 public ActionResult Admin()
    {

        string apiUri = Url.HttpRouteUrl("DefaultApi", new { controller = "testModel", });
        ViewBag.ApiUrl = new Uri(Request.Url, apiUri).AbsoluteUri.ToString();

        return View();
    }

So that I can enable routing to my Admin controller. However I get the following output in the browser:

https://i.stack.imgur.com/3JCq4.png

I 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:

 Url.RouteUrl

instead of

 Url.HttpRouteUrl

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:

   '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?)

As reference, this is the article I am using to assist this portion of the project:

http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-entity-framework/using-web-api-with-entity-framework,-part-4

I appreciate the help(this is very different from OpenGl and DirectX)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:45:07+00:00Added an answer on June 11, 2026 at 9:45 pm

    Since this is a standard MVC controller action, not an ApiController action, the Url property inside this controller is just the standard UrlHelper.

    You could use the following:

    public ActionResult Admin()
    {
        string apiUri = Url.RouteUrl(
            "DefaultApi", 
            new { httproute = "", controller = "Values" }, 
            Request.Url.Scheme
        );
        ViewBag.ApiUrl = apiUri;
        return View();
    }
    

    Notice the httproute = "" that is used in the routeValues parameter as well as how specifying the protocol argument generates an absolute url so that you don’t need to tweak with by creating new Uri objects and stuff..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty new to ASP.NET and trying to figure out how to have the code
Im pretty new to Linux in general. Ive just been following this tutorial(http://net.tutsplus.com/tutorials/php/how-to-setup-a-dedicated-web-server-for-free/) to
I'm a pretty new C# and .NET developer. I recently created an MMC snapin
I am pretty new to VB.NET - and I'm struggling to convert the signature
Pretty new to this kind of development. Wondering if anyone can point me in
Pretty new to all this so excuse any beginner mistakes. I was wondering if
Pretty new to MVC and the like. I have a class the looks like
Pretty new to Perl so there may be a very obvious solution here. I'm
Im pretty new to Java Web Services, but I cant find a good explanation
I pretty new to Objective-C (and C itself) and need to consume a NSData

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.