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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:28:21+00:00 2026-05-27T20:28:21+00:00

I have two routes, when I use the Default route it shows the url

  • 0

I have two routes, when I use the Default route it shows the url with Question mark in the parameter. I’m getting Editar/id?3 — instead Editar/id/3. The other route is working fine, could you give me some light. Thanks.

Global.asax

public class MvcApplication : System.Web.HttpApplication
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "GaleriaCustom", // Route name
            "{controller}/{action}/{categoria}/{subCategoria}", // URL with parameters
            new { controller = "Galeria", action = "Index", categoria = "Noivinhos", subCategoria = UrlParameter.Optional } // Parameter defaults
        );

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );           



    }

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterRoutes(RouteTable.Routes);
    }
}

Index.aspx — wrong url Editar/id?3 — instead Editar/id/3

<a href="<%: Url.Action("Editar", new{ id = item.galeria_id }) %>"><img src="<%: Url.Content("~/Content/Img/Design/editar.png") %>" alt="Editar" title="Editar"/></a> 
<a href="<%: Url.Action("Detalhe", new { id=item.galeria_id }) %>"><img src="<%: Url.Content("~/Content/Img/Design/detalhe.png") %>" alt="Detalhe" title="Detalhe"/></a> 
<a href="<%: Url.Action("Excluir", new { id=item.galeria_id }) %>"><img src="<%: Url.Content("~/Content/Img/Design/delete.png") %>" alt="Excluir" title="Excluir"/></a> 
  • 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-27T20:28:22+00:00Added an answer on May 27, 2026 at 8:28 pm

    Your first route is more greedy than the second and unless you use some constraints it will match all urls. Another possibility is to use the RouteUrl helper and specify the name of the route:

    <%= Url.RouteUrl("Default", new { action = "Editar", id = item.galeria_id }) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two routes in my area, one custom and one default fallback route,
I have a question regarding RouteLink vs. ActionLink. Consider the following route routes.MapRoute(Routename1, {someEnum}/SpecificAction/{id}/{stringId},
I have this two routes currently in my application after decommenting out many other
I use asp.net 4 c# and routing. I have two routes, as you can
I have two tables, one for routes and one for airports. Routes contains just
I have a web site with two routes. Basically the user can do one
I have two OverlayItem's on a MapView. How can I draw a route between
I have two applications written in Java that communicate with each other using XML
Here's my dilemma: I have two types of routes which are semantically very different,
I have 2 urls /Data and /Data/{month}/{day}/{year}. I've created two routes routes.MapRoute( Data_Name, Data,

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.