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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:16:24+00:00 2026-06-10T00:16:24+00:00

This is how I think that this works http://stackoverflow.com/questions/12333706/how-to-bla-bla-question I think that there should

  • 0

This is how I think that this works

http://stackoverflow.com/questions/12333706/how-to-bla-bla-question

I think that there should be a controller action and link

@Html.ActionLink("how-to-bla-bla-question", "Questions", "Controller", new{questionId=12333706})
...
public ActionResult Questions(questionId)
{
    ...
}

Normally url should be

http://stackoverflow.com/questions/12333706/

Now is this handled by javascript or there is some other method how to make url with ID and title after it?

  • 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-10T00:16:25+00:00Added an answer on June 10, 2026 at 12:16 am

    I have done exactly that like this.

    Global.asax snippet:

    routes.MapRoute(
            "GotoPostOrPage",
            "p/{dataItemTypeId}/{dataItemId}/{ignored}", // This allows you to append a random slug if you like
            new { controller = "DataItem", action = "Details", ignored = UrlParameter.Optional }
            );
    

    And then something like this in the controller:

    public PartialViewResult Details(int dataItemTypeId, int dataItemId)
    {
        IDataItemView dataItem = _dataItemService.SelectDataItem(dataItemTypeId, dataItemId);
        DataItemViewModel vm = MappingFunctions.DataItemToViewModel(dataItem);
    
        return PartialView("_Details", vm);
    }
    

    Note that this allows you to append a random slug which is exactly what stackoverflow does. However, stackoverflow then corrects your slug to the one stored in the database. This would be trivial to implement.

    Also note that I have shown you my real code; you’d obviously need to tweak it a little bit (but not much) to fit your scenario. The important point is to append an optional url parameter in the route table. In my case I ignore it completely, which is actually what SO does too on the way in, hence you can navigate to this daft URL and still get here: https://stackoverflow.com/questions/12051094/i-like-to-eat-cake

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

Sidebar

Related Questions

I noticed that HTTP://STACKOVERFLOW.COM/QUESTIONS/ASK and http://stackoverflow.com/questions/ask both works fine - actually the previous one
I saw this link (http://stackoverflow.com/questions/6603868/android-onclicklistener-and-table-layout) which seems like it works for the person asking
You might think that this question is already answered. However, I couldn't find the
sed 's/^\(\h*\)\(.*\)$/\1<!-- \2 -->/' web.xml I think that this should take this xml: <a>
[I hope that this question is not too broad, I think that the subject
This is a general question of sorts, but do you think that it's important
I've noticed that some sites (including the old http://careers.stackoverflow.com 1.0) have query strings that
some of the questions i have read http://facebook.stackoverflow.com/questions/1927676/scraping-a-facebook-app-for-data http://facebook.stackoverflow.com/questions/2028940/access-to-facebook-data I want to create a
So I'm getting some problem similar to this: ttp://stackoverflow.com/questions/3694475/asp-net-forms-authentication-authenticates-in-localhost-server-but-not-on-the-w but I'm using MVC 3.0
I think that this problem can be sorted using reflection (a technology which I'm

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.