Пример #1
0
 public void Process(CustomPipelineArgs args)
 {
     if (args.CurrItem["date"] == string.Empty)
     {
         args.IsValid = false;
         args.Message = "Date has not been set";
     }
 }
 // GET: Default
 public void Index()
 {
     CustomPipelineArgs pipelineArgs = new CustomPipelineArgs(Sitecore.Context.Item);
     CorePipeline.Run("CustomPipeline", pipelineArgs);
     if (!pipelineArgs.IsValid && !string.IsNullOrEmpty(pipelineArgs.Message))
     {
         // Execute code here to deal with failed validation
     } 
 }