SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a DateTimeControl on my WebPage which i is a ReqiredField. I have set the properties of the control as follows

<SharePoint:DateTimeControl runat="server" ID="txtDOB" DateOnly="True" LocaleId="2057" IsRequiredField="true" ErrorMessage="*">

I have set the Error Message to * but i get the mesage as You must specify a value for this required field. instead of *

Please help me to display ErrorMEssage as * instead of the default long message. How can i do it?

share|improve this question
up vote 1 down vote accepted

For Custom Error Message you use this Code..

<sharepoint:datetimecontrol id="dteDemo" runat="server" dateonly="true" />
<asp:CompareValidator ID="valDate" runat="server" ForeColor="Red" ControlToValidate="dteDemo$dteDemoDate"
            Type="Date" Operator="DataTypeCheck" ErrorMessage="*">
share|improve this answer
ControlToValidate="dteDemo$dteDemoDate" how do i set it to my control id ID="txtDOB" should it be ControlToValidate="txtDOB$txtDOBDate" – Ishan Mar 19 '12 at 7:09
just try and see the result Ishan – Ravi Suthar Mar 19 '12 at 7:19
Welll i used required field validator.thank you for the help. can u please explain me what dteDemo$dteDemoDate means? What this does? Because in ControlToValidate we only specify control ID, without any dollar or anything. – Ishan Mar 19 '12 at 9:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.