Do validations still fire in ASP.NET even if the controls are hidden?

Posted by Josh on Stack Overflow See other posts from Stack Overflow or by Josh
Published on 2010-06-02T23:10:53Z Indexed on 2010/06/02 23:14 UTC
Read the original article Hit count: 182

Filed under:
|

I have a form that uses ASP.NET validations. I am using some inline C# in the aspx to show/hide certain controls depending on a user's role. I would use the Visible property, but there are so many of them, I just decided to do inline C# to show and hide (I know, not best practice, but bear with me for a second). I am having an issue where Page.IsValid is always set to False when I submit my form (when certain fields are being hidden). Will the validations still fire off even if the controls are not even rendered on the pag? Also, if this is not the case, is there an effective way of breaking down Page.IsValid to find out what is setting it to False? Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about validations