I am trying to create my first custom form control that I can add into a webform in an ascx file
All is going OK but I dont know how to access the properties of the form control in code so that I can dynamically change the behaviour.
I have a form control which I defined a field called "UploadType".
In a webpart I have registered my new form control and have several instances of it within the webpart and all is displayed OK.
<%@ Register Src="~/CMSFormControls/KBC/OnboardingUploadControl.ascx" TagName="OnboardingUploader" TagPrefix="cms" %>
<cms:OnboardingUploader ID="driversLicenceUpload" UploadType="DRIVING_LICENSE" runat="server" />
<cms:OnboardingUploader ID="passportUpload" UploadType="PASSPORT" runat="server" />
<cms:OnboardingUploader ID="billUpload" UploadType="BILL" runat="server" />
<cms:OnboardingUploader ID="otherUpload" UploadType="OTHER" runat="server" />
I have set the UploadType of the control but now want to access the property within the code. The below code never finds the value of UploadType.
string uploadType = ValidationHelper.GetString(GetValue("UploadType"), "");
Should I be using another accessor function or am I looking in the wrong collection?
Also is it possible to set the value of the UploadType in code i.e
driversLicenceUpload.UploadType = "DRIVING_LICENSE"; as this is not acceptable either