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 8313715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:35:01+00:00 2026-06-08T20:35:01+00:00

I am using RedirectToAction in my ASP.Net WebAPI application and I tried the following

  • 0

I am using RedirectToAction in my ASP.Net WebAPI application and I tried the following one.

return RedirectToAction("AuthenticateUser", "AuthenticationServiceWebApi", new RouteValueDictionary
                                                                    {
                                                                        {"userName", model.UserName},
                                                                        {"password", model.Password}
                                                                    });

This generates the redirection as below.

127.0.0.1:81/authenticationservicewebapi/authenticateuser/admin/admin@123

But, since I am using WebAPI, I need to be the URL like below.

127.0.0.1:81/api/authenticationservicewebapi/authenticateuser/admin/admin@123

How do I do this?

  • 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-08T20:35:03+00:00Added an answer on June 8, 2026 at 8:35 pm

    I’m not sure how your routing, Web API action signature look like so I will try to guess.
    A few things don’t really add up here (why would you pass the password in the url?)

    but…

    Given your url structure I’d guess your routing is something like:

        routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{action}/{id}/{id2}",
            defaults: new { id = RouteParameter.Optional, id2 = RouteParameter.Optional }
        );
    

    Then given that, I guess your authenticateuser must be something like:

    public HttpResponseMessage AuthenticateUser([FromUri]string id, [FromUri]string id2)
    

    If so, then to redirect to this from an MVC controller you need:

            return Redirect(
                Url.RouteUrl("DefaultApi", 
                    new { httproute = "", 
                          controller = "AuthenticationServiceWebApi", 
                          action = "AuthenticateUser", 
                          id = model.UserName,
                          id2 = model.Password
                }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
Why in ASP.NET MVC is it when I use a: return this.RedirectToAction(Index, Page, new
Using ASP.Net MVC 2, is there any way to use the RedirectToAction() method of
I'd like to move an asp.net mvc response to http://example.com/emails/list/rob@email.com Using RedirectToAction(list, emails, new
In ASP.NET MVC you can return a redirect ActionResult quite easily: return RedirectToAction("Index"); or
I am trying to integrate facebook with in my asp.net mvc web application using
I'm using jquerymobile and asp.net MVC3 razor. I'm somewhat new to this, but figuring
I have a ASP.NET MVC 2.0 application using Entity Framework. All my views use
I'm working on an application using ASP.NET 4.0 and MVC 2.0. If it's in
I'm using OpenId in my ASP.NET MVC application. Works great :) Once i have

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.