SaaS CMS has officially launched! Learn more now.

Regular expression isnt working as expected on one of the fields in block



I am attempting to create a regular expression for one of the fields in my component block however it doesnt seem to be working. the field needs to accept forward slashes

  [Display(Name = "Theme",
            Description = "Choose from pre-defined Theme",
            GroupName = TabNames.CampaignSettings,
            Order = 10)]
        public virtual string Theme { get; set; }

Does anyone know what im doing wrong here?


Edited, Aug 30, 2023 16:24

How do you mean it "doesn't seem to be working"? It should only allow ContentReference so / is not allowed even if you have regex allow it

Aug 31, 2023 5:59

Hi quan, my apologies, i posted the wrong code! I've updated my post again and replaced it with the correct field. There is a drop down list in the campaign settings, and when i select one of the string theme names, and publish the  page, the drop down list appears empty instead of being populated.

Edited, Aug 31, 2023 9:43

I'd use an enum property.. much cleaner. Only works if your Themes are really very predefined of course. 

Sep 01, 2023 0:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.