Tuesday, November 6, 2012

SharePoint DateTimeControl validation



Here i am explaining how to validate a sharepoint datetime control with asp.net required field validator.

Datetime control is a very easy to use but internally it is having a drawback of required validation property.

It has a property called IsRequiredField But it will not work for date format validation when you are working with Visual web parts or web parts.

For this we have to use classical ASP.NET required field validator to validate control

Internally the DateTimeControl of SharePoint is just a calendar dropdown and a text box. Also, they already implemented a simple required field validation by just using the IsRequiredField property.

However, if you try to put an asp.net validator (i.e.: CompareValidator, RegularExpressionValidtator, etc…) on it, it says it can’t find the control. This is happening because the DateTimeControl is just a wrapper around this textbox and if you set the Validator ControlToValidate property to the DateTimeControl it isn’t smart enough to know to really validate against the actual textbox

Here is the way you need to define

  






NOTE : Here ControlToValidate property you need to set as {DateControlID}${DateControlID}Date then only it will work otherwise it will through error

Thank you !!!




36 comments:

  1. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    Digital Marketing Training in Chennai

    Digital Marketing Training in Bangalore

    digital marketing training in tambaram

    digital marketing training in annanagar

    ReplyDelete
  2. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    full stack developer training in annanagar

    full stack developer training in tambaram

    full stack developer training in velachery

    ReplyDelete
  3. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Blueprism training in Pune

    Blueprism online training

    Blue Prism Training in Pune

    ReplyDelete
  4. Were a gaggle of volunteers as well as starting off a brand new gumption within a community. Your blog furnished us precious details to be effective on. You've got completed any amazing work!
    java training in chennai

    java training in marathahalli | java training in btm layout

    ReplyDelete
  5. Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up!

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

    ReplyDelete
  6. You’ve written a really great article here. Your writing style makes this material easy to understand.. I agree with some of the many points you have made. Thank you for this is real thought-provoking content
    Microsoft Azure online training
    Selenium online training
    Java online training
    Java Script online training
    Share Point online training

    ReplyDelete
  7. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  8. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. ExcelR Pune Digital Marketing Course Any way I’ll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

    ReplyDelete
  9. i got benefited from this..do more ,share more

    BEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT

    https://www.acte.in/angular-js-training-in-chennai
    https://www.acte.in/angular-js-training-in-annanagar
    https://www.acte.in/angular-js-training-in-omr
    https://www.acte.in/angular-js-training-in-porur
    https://www.acte.in/angular-js-training-in-tambaram
    https://www.acte.in/angular-js-training-in-velachery


    ReplyDelete
  10. It is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog. Please, continue to give me such valuable posts.
    hardware and networking training in chennai

    hardware and networking training in tambaram

    xamarin training in chennai

    xamarin training in tambaram

    ios training in chennai

    ios training in tambaram

    iot training in chennai

    iot training in tambaram

    ReplyDelete
  11. Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!!
    360digitmg

    ReplyDelete
  12. Really it is very useful for us..... the information that you have shared is really useful for everyone.Nice article i have ever read information's like this.it's really awesome the way you have delivered your ideas.i hope you will add more content in your blog
    Java Training in Chennai

    Java Training in Velachery

    Java Training inTambaram

    Java Training in Porur

    Java Training in Omr

    Java Training in Annanagar

    ReplyDelete
  13. It was really helpful for me. Every tip is useful and innovating to understand easily. I feel happy and thanks for sharing this kind of valuable concept. amazon web services aws training in chennai

    microsoft azure training in chennai

    workday training in chennai

    android-training-in chennai

    ios training in chennai

    ReplyDelete
  14. Thanks for sharing information to our knowledge, it helps me plenty keep sharing…

    Big Data Hadoop Online Training
    Online training for big data

    ReplyDelete
  15. I was searching some blogs to read on google and found this blog post page. I must say it is very informative as well as interesting. Thanks to the author of this post/page for writing such wonderful lines. Feel free to visit my website; 온라인카지노

    ReplyDelete
  16. I like what you guys are up also. Such clever work and reporting! Carry on the excellent works guys I?|ve incorporated you guys to my blogroll. I think it will improve the value of my website. Feel free to visit my website; 온라인카지노

    ReplyDelete
  17. we are living a world where technologies are everything we can't even go far further from it.
    온라인카지노

    ReplyDelete
  18. i love reading this article so beautiful!!great job! 토토사이트

    ReplyDelete
  19. I read a article under the same title some time ago, but this articles quality is much, much better. How you do this.. 출장마사지

    ReplyDelete