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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:17:23+00:00 2026-05-23T16:17:23+00:00

I have been tasked with creating a user control to live in our master

  • 0

I have been tasked with creating a user control to live in our master page that allows users to switch between accounts. This way, we can allow users to change their account without having to go back to the accounts page. This seemed like a legitimate and perfectly straightforward task.

I’ve built the control and added it to the master page using Html.RenderAction. The last step is for me to redirect the user to the home page for that account. In order to do this, I build a route to the home page and attempt return RedirectToRoute(route).

When I attempt this, I get this error:

Child actions are not allowed to perform redirect actions

Anyone have any ideas on how to resolve this or have I coded myself into a box

Thanks in advance

  • 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-05-23T16:17:24+00:00Added an answer on May 23, 2026 at 4:17 pm

    You can cheat with an ugly hack:

    [ChildActionOnly]
    public ActionResult SomeUserControlAction()
    {
        // ... some processing
    
        var url = Url.RouteUrl("routeName", new 
        { 
            action = "foo",
            controller = "bar"
        });
        Response.Redirect(url);
        return null;
    }
    

    It’s so ugly that I feel ashamed for even mentioning it, but it works.

    Another possibility would be to pass the url as part of the view model to the view and perform the redirect in javascript by setting window.location.href to the new url.

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

Sidebar

Related Questions

I have been tasked with creating a program that will generate an amortization schedule.
I have been tasked with creating a reusable process for our Finance Dept to
I am new to WIX and have been tasked with creating an installer that
I have been tasked with creating a Software Installation Approval section for our Intranet.
Recently I have been tasked with creating an application for a business that basically
I'm new to visual basic and have been tasked with creating an app that
I have been tasked with creating a service that will be consumed by jQuery
So I've been tasked with creating a tool for our QA department that can
I have been tasked with creating a program what will create take files in
I have been tasked with going through a number of ColdFusion sites that 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.