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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:27:37+00:00 2026-06-05T06:27:37+00:00

I have an MVC 3 application where I want dynamic Urls which do not

  • 0

I have an MVC 3 application where I want dynamic Urls which do not contain a controller or key name. A good example of this would be if I had a blog, and users add in new posts.

Say a user creates a post called

My Blog Post

I have a method that creates a url SLUG and stores it in the database with the entry, so I want the Url to be

/my-blog-post

This has no controller or key name in the url now? How do I achieve this with MVC routing? Currently I’m doing it by matching the Url with an ID like /my-blog-post_1234 and using that ID as the DB lookup key using fluent nhibernate but I’m a little lost once I remove the ID?

As I can still get the string/slug, but that means I now have to do a SQL lookup based on the string ‘my-blog-post’? I have read this is not efficient and could compromise speed, and some of these titles could be pretty long.

I’ve heard people saying things about custom route tables? Would this help me or not? I suppose the main thing is getting the data from the database in the quickest most efficient way.

any help/pointers greatly appreciated.

  • 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-05T06:27:39+00:00Added an answer on June 5, 2026 at 6:27 am

    The MVC framework isn’t going to provide any help here. Your requirement is to query by slug, so that’s what you’ll need to do in the DB.

    You just need to make sure you have an index on this column in the DB to make sure the query doesn’t need to do a table scan.

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

Sidebar

Related Questions

I have an ASP.MVC application which has a silverlight app inside. I want to
I have an mvc application in which I want to make the texbox readable,i
I have a ASP.NET MVC application for which I want to write some stress
I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7
I have created blank Asp.Net-MVC 3 web application and want to write my own
I have a Asp.net MVC web application, containing mostly text. I want to put
I have MVC webApi application which works with Unity . I have to resolve
I have a MVC application. I added a Service Reference to it. All good.
I have an ASP MVC application which uses some silverlight applications in the View.
I currently have an ASP.NET MVC application that exists. I want to add a

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.