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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:57:00+00:00 2026-05-12T00:57:00+00:00

In my scenario I’d like to display a text with URL link within validation

  • 0

In my scenario I’d like to display a text with URL link within validation message attached to form element on MVC view. I’m using ValidationExtensions.ValidationMessage extension method, like this:

<%=Html.ValidationMessage(Model.Name) %>

The behavior I’m seeing is that validation message is HTML escaped, what effectively prevents me from adding a link to message. Is there a way to circumvent this behavior? My error messages aren’t user-supplied, so I don’t think I have to worry about output sanitization here…

  • 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-12T00:57:01+00:00Added an answer on May 12, 2026 at 12:57 am

    I’m guessing that since Html.ValidationMessage is built in you’re going to either create your own version, or if you’re feeling creative, since it returns a string, assign that and then unescape the characters you want to change back.

    string validation = Html.ValidationMessage(Model.Name);
    validation = Regex.Replace(validation, "&gt;", "<");
    //etc...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: User is viewing a screen with an image and some accompanying text in
Scenario: The user is entering a date in an NSDatePicker in its textual form
Scenario : I have an ASP.NET MVC application developed in Visual Studio 2008. There
Scenario: UserControl that has a read-only TextBox and a Button. TextBox.Text is modified and
Scenario: Think you have got 90TB of text in 200 tables. This is structured
SCENARIO: I have bunch of matches. I want to create in my view a
Scenario: .I have 30 tips in xml file, now I want to display it
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario: I have a text file that has pipe (as in the | character)
Scenario : I have a ContentControl in my View whose Content property is bound

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.