About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



Custom Field Validation With SPFieldValidationException

There was a post in the newsgroups wondering how when constructing a custom field type how one might build a small generic validation function in order to verify the harvested user input. There is provided the SPField.GetValidatedString method, which is overridable, that can be used in order to achieve this since it will take the object input provided by the custom field type and provide a workable string representation.

An example of this method is this:

C#:
  1. private readonly string m_strValidationException = "Hmmm, your string length wasen't 10!";
  2.  
  3. public override string GetValidatedString(object oValue)
  4. {
  5. if (oValue.ToString().Length != 10)
  6.  
  7. {
  8. throw new SPFieldValidationException(m_strValidationException);
  9. }
  10.  
  11. else
  12.  
  13. {
  14. return oValue.ToString();
  15. }
  16.  
  17. }

  • Share/Bookmark

2 Comments »

  1. [...] There was a post in the newsgroups wondering how when constructing a custom field type how one might build a small generic validation function in order to verify the harvested user input. There is provided the SPField.GetValidatedString method, which Read More……(read more) October 13th 2007 Posted to Uncategorized [...]

    Pingback by Blogger Loser » Custom Field Validation With SPFieldValidationException — October 13, 2007 @ 4:57 pm

  2. [...] desconocido wrote an interesting post today!.Here’s a quick excerptThere was a post in the newsgroups wondering how when constructing a custom field type how one might build a small generic validation function in order to verify the harvested user input. There is provided the SPField. … [...]

    Pingback by ThemePassion - Best stuff about design! » Custom Field Validation With SPFieldValidationException — October 25, 2007 @ 5:27 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment