0

Html.ValidationFor automatically applies input-validation-error css class to the target textbox. However the css is not mine to edit and I'm not allowed to change it (i.e. rename the sitebuild's error class to input-validation-error). Can I change the helper applies to the textbox somehow?

2 Answers 2

1

Actually a co-worker of mine solved the issue. HtmlHelper has private static fields (like ValidationInputCssClassName), which contain the classes as strings.

He called SetValue (by Reflection) on them...

Sign up to request clarification or add additional context in comments.

Comments

0

Those constants are hardcoded in the HtmlHelper class. You will have to write custom html helpers if you want to use different names. Probably would be a lot of work, much more than simply using those names in your CSS file.

1 Comment

I've already sent the email to the buyer asking to change the css. Hoping for some non-hard-headedness. I won't delete this answer in case anyone in the future wonders the same...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.