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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:26:41+00:00 2026-05-24T18:26:41+00:00

I am setting up a feature on my site that requires displaying content that

  • 0

I am setting up a feature on my site that requires displaying content that is stored in the database. This content will frequently have links to other resources on the site.

Stored in the db:

"Lorem ipsum dolor sit <a href='http://mysite.com/somecontroller/someaction'>amet</a>."

For debugging and other reasons, I don’t want to hard code that url. I want to replace http://mysite.com/somecontroller/someaction with UrlHelper.Action("somecontroller", "someaction").

I could write a replacement based on my own made up convention. That would be easy and accomplish what I want to do. However, I thought I might be missing some cleaner or more standard solution. So, is there a cleaner more maintainable way to do this, or should I go ahead with a convention based replacement?

  • 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-24T18:26:42+00:00Added an answer on May 24, 2026 at 6:26 pm

    Replacement is probably best, and easiest to maintain. Another way to handle it is to allow ASP.Net to parse the code. You’d have to create your own VirtualPathProvider which would allow Views to be pulled from the database in addition to the file system. Then you could use

    Html.RenderPartial(nameVirtualPathProviderUnderstands);
    

    Which would render the string in the database as if it were a file. Although this isn’t very safe, and you would need to modify the content before the VirtualPathProvider rendered it. Here is a guide which explains how to implement your own VirtualPathProvider.

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

Sidebar

Related Questions

I have an ASP.NET Webforms site that is regularly having features added. The majority
I have a problem that i've struggled with for a long time. This problem
I currently have a webview that displays a current site. However, it cuts off
I have a site that has different features and functionality based on the location
I have a SharePoint solution, containing 3 Features. One feature is Site scoped, and
I have SharePoint site with publishing features enabled. I have a custom content type
I know that this feature is to enhance user experience (by not retyping their
I have a few Eclipse plugins that are part of a feature. We would
I have a page with title and content blocks. User must have a feature
Sometimes when some feature requires many different settings, they are written in a cloze

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.