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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:48:10+00:00 2026-05-23T15:48:10+00:00

It seems that ASP.NET validators do not validate hidden fields. I get messages like

  • 0

It seems that ASP.NET validators do not validate hidden fields. I get messages like this:

Control ‘hiddenField’ referenced by the ControlToValidate property of ‘hiddenFieldValidator’ cannot be validated.

I have an <asp:HiddenField> in my page which gets filled client side with some value. I need this to be present once on the server so I added a RequiredFieldValidator to it.

And it does not work!

As I see it, as a workaround, I can:

1. use a custom validator and not tie it to the hidden field, just call a method on OnServerValidate;

2. Use a <asp:TextBox> with a CSS style display:none and it should work.

But I want to make sure I am not missing something here. Is it possible or not to validate a hidden field in the same way as the other text fields? O maybe a third, more elegant option?

TIA!

  • 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-23T15:48:11+00:00Added an answer on May 23, 2026 at 3:48 pm

    Just as the exception message you’re getting says, it seems HiddenField controls can’t be targeted by the standard validation controls directly. I would go with the CustomValidator workaround.

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

Sidebar

Related Questions

I'm learning ASP.NET MVC Framework, From some articles like this , it seems that
Using asp.net validators, I'd like a control similar to the validation summary, except that
it seems that I just solved my problem why I couldn't use the ASP.NET
How ASP.NET compiles its assemblies generally confuses me. It seems that I cannot program
Seems that requirements on safety do not seem to like systems that use AI
It seems that ASP.NET MVC just runs on top of ASP.NET WebForms. System.Web.Mvc.ViewPage in
It seems that the default ASP.NET MVC2 Html helper generates duplicate HTML IDs when
I have built an ASP.NET mvc web application and it seems that some of
It seems that when adding a row to an ASP.NET GridView, the Tab Index
I have a pretty simple ASP.NET page with some input fields and validators. One

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.