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

  • Home
  • SEARCH
  • 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 5988825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:00:49+00:00 2026-05-22T23:00:49+00:00

This was my original code: @Url.Action(LoginYoutube, Account, new { returnUrl = Request.QueryString[ReturnUrl] }, http)

  • 0

This was my original code:

@Url.Action("LoginYoutube", "Account", new { returnUrl = Request.QueryString["ReturnUrl"] }, "http")

Which would generate: http://localhost:2543/Account/LoginYoutube

With T4MVC I do:

Url.Action(MVC.Account.LoginYoutube().AddRouteValue("returnUrl", Request.QueryString["ReturnUrl"]))

and that generates: /Account/LoginYoutube

I need the last parameter with “http” in order to get the http://localhost:2543. The problem is with T4MVC I can only put 1 parameter for the call to Url.Action().

How can I get this to work?

  • 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-22T23:00:49+00:00Added an answer on May 22, 2026 at 11:00 pm

    T4MVC is indeed missing something here, but it should be easy to add. Please try the following. In T4MVC.tt, change:

        public static string Action(this UrlHelper urlHelper, ActionResult result) {
            return urlHelper.RouteUrl(result.GetRouteValueDictionary());
        }
    

    to

        public static string Action(this UrlHelper urlHelper, ActionResult result, string protocol = null, string hostName = null) {
            return urlHelper.RouteUrl(null, result.GetRouteValueDictionary(), protocol, hostName);
        }
    

    This should allow you to write:

     @Url.Action(MVC.Account.LoginYoutube().AddRouteValue("returnUrl", Request.QueryString["ReturnUrl"]), "http")
    

    Please let me know how that works, so we can decide whether to change this in the official template.

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

Sidebar

Related Questions

I have url rewrite rules which redirect www.domain2.com to a subfolder under the root
I am using ASP.NET MVC 3. I have an action method called New. When
i'm trying to make some change in the following code which updates the number
Initially this demo application I'm working on had just one page with a simple
I have an admin webapp.one have to login before perfoming any action.Now the /default/index/index
Here is the code (Seam 2, JSF 1.2) <s:link style=color: white; value=Full Listing rendered=#{not
I currently have a Rails website that has some Prototype scripting in it. My
I'm trying to add pagination to my wordpress search results. I was able to
Okay, I'm not doing anything fancy here, but it's driving me crazy that I
I've been trying to make a JavaScript function for a Google Chrome web-application that

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.