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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:26:32+00:00 2026-05-19T02:26:32+00:00

I would like to intercept the < character in the form field by a

  • 0

I would like to intercept the “<” character in the form field by a regex validator. I will describe the problem in 3 steps:

Step 1: When I try to submit a form with a field containing the “<” character, I get the “Potentially dangerous request…” – as expected in ASP.NET.

Step 2: To avoid ASP.NET’s RequestValidation, I decorate my Update method in the controller with “[ValidateInput(false)]”.

It works as expected – now I can post “<” character without error.

Step 3: I use xVal with DataAnnotations. For example, [Required] or [StringLength(255)] works as expected.

BUT when I use:
[RegularExpression
(“^[^<>]*$”, ErrorMessage = “Special characters are not allowed.”)], I get the “Potentially dangeros request…” error again, despite the [ValidateInput(false)] directive.

What’s happening? Is there a simpler way for regex validaton, but with [ValidateInput(false)] in place? Of course, I’d like to have my validation code in the model, not in the controller.

  • 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-19T02:26:32+00:00Added an answer on May 19, 2026 at 2:26 am

    No, it was an issue in MVC 1 + xVal.
    In MVC 2 the validation works as
    supposed (and there’s no need for xVal
    anymore) – Alex42

    Looks like the bot keeps on pushing this one to the top still. Could you mark an answer as accepted so that it knows?

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

Sidebar

Related Questions

I have a problem - I would like to intercept all actions done on
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to intercept persistence operations over collection properties, decide by myself if
I would like to intercept the event in a .NET Windows Forms TabControl when
I want the user to submit a form and get a pdf back. Like
I would like to visually evaluate web pages response time for several Internet connections
I would like to create an application that connects to the internet by using
PHP/MySQL (CodeIgniter) I would like to add new interest_keywords in the exist database value.
I need to change the firefox window title like I would do for internet
Would like to be able to set colors of headings and such, different font

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.