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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:39:24+00:00 2026-06-03T05:39:24+00:00

I have implemented arbitrary links in my rtb using the CodeProject found here .

  • 0

I have implemented arbitrary links in my rtb using the CodeProject found here. The links are not truly links but instead data that is looked up when clicked and returned expanded information on the item clicked.

This all works great. The problem is when I try to save the data off to a database using the RichTextBox1.Rtf method the links are lost. I end up with the value of the text but there is no link data saved off in the Rtf. Is there no Rtf code for hyperlinks? Is there no way around this issue?

I am considering adjusting my approach to something more in line with this issue but I don’t want to change everything around if I can find a way to save my custom hyperlinks.

Any suggestions would be great!

—————UPDATE—————-

Before submitting I did a bit more digging and dug up this blog article which discusses that RTB do not save hyperlinks so I guess I am SOL. The only way around this is by saving off the text in hidden textbox and save that version to the db but that way gets clunky. I think I will go with the second option I found and I thought I would post this anyway since data in StackOverflow seems slim on this topic. Now I know why.

  • 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-03T05:39:25+00:00Added an answer on June 3, 2026 at 5:39 am

    To summarize, Rich Text Boxes do not save hyperlinks in the .Rtf field (nor text). The value of the display is saved but not the actual link. Seems like a poor limitation to RTB’s IMHO.

    There are ways around this case, create custom links like this fellow did or re-evaluate your data on load searching for the keywords (the route I took since the data will never get too large to cause freezing).

    The code I used to perform this is as follows and called on load:

                foreach (ListViewItem keyword in Keywords.Items)
                {
                    System.Text.RegularExpressions.Regex oKeyword = new System.Text.RegularExpressions.Regex(@"\b" + keyword.Text + @"\b");
    
                    foreach (System.Text.RegularExpressions.Match match in oKeyword.Matches(rtb.Text))
                    {
                        int index = match.Index;
                        int length = match.Length;
    
                        rtb.Select(index, length);
                        //This next bit is made available through the use of http://www.codeproject.com/Articles/9196/Links-with-arbitrary-text-in-a-RichTextBox
                        rtb.InsertLink(match.Value);  
                    }
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a VSS requester, and it links compiles and executes on Windows
I have implemented a DAL using Rob Conery's spin on the repository pattern (from
I have a saving/loading framework that is supposed to save arbitrary object graphs. This
I found some code using std::shared_ptr to perform arbitrary cleanup at shutdown. At first
I have implemented the A* algorithm in AS3 and it works great except for
I have implemented Facebook Connect into a HTML page exactly as the tutorial explains
I have implemented a ToString() override method for my class in my Webservice and
I have implemented a sort of Repository class and it has has GetByID ,
I have implemented a printer delivery extension based on MS example in SSRS 2005.
I have implemented a custom ActionMapper which obtains the locale from the URI (the

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.