Error executing template "Designs/dechra-dvp/UserManagement/CreateProfile/user-create.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_b243e1006c994738971a7b754c12e279.Execute() in D:\Dynamicweb.NET\Solutions\us.dvp.dechra.espresso4.dk\Files\Templates\Designs\dechra-dvp\UserManagement\CreateProfile\user-create.cshtml:line 14
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web; 2 @using System.Globalization; 3 @using Dynamicweb.Frontend; 4 @using Dynamicweb.Content; 5 @using Co3.Dechra.DVP.Website.UiServices; 6 @using Co3.Espresso.Base.Extensions; 7 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ParagraphBase 8 @{ 9 PageView currentPageView = PageView.Current(); 10 Area currentArea = currentPageView.Area; 11 int areaId = currentPageView.AreaID; 12 13 List<string> enabledUserFields = currentArea.Item["EnableUserFields"].ToString().Split(',').ToList(); 14 string[] jobTitleOptions = currentArea.Item["JobTitleOptions"].ToString().Split(','); 15 string[] practiceTypeOptions = currentArea.Item["PracticeTypeOptions"].ToString().Split(','); 16 17 string policyPageId = currentArea.Item["PolicyPage"].ToString(); 18 19 string countryCode = CountryUiService.GetCountryCode(currentArea); 20 } 21 22 @foreach (LoopItem error in GetLoop("FormValidationErrors")) 23 { 24 string errorFieldName = error.GetString("UserManagement:User.FormValidationError.FieldNiceName"); 25 26 if (errorFieldName == "Username") 27 { 28 errorFieldName = "Email"; 29 } 30 31 <div class="container"> 32 <div class="col-12 alert-danger py-2 mb-1"> 33 @error.GetString("UserManagement:User.FormValidationError.Message") 34 </div> 35 </div> 36 } 37 38 @if(!string.IsNullOrEmpty(HttpContext.Current.Request["errorMessage"])) 39 { 40 string errorMessage = HttpUtility.HtmlEncode(HttpContext.Current.Request["errorMessage"]); 41 42 <div class="container"> 43 <div class="col-12 alert-danger py-2 mb-1"> 44 @errorMessage 45 </div> 46 </div> 47 } 48 49 <div class="container"> 50 @GetValue("UserManagement:User.FormStart") 51 <input type="hidden" name="CustomField.AccessUser_AccessUser_siteid" value="@areaId" /> 52 <div class="row"> 53 <div class="col-12"> 54 <h2>@Translate("Sign up for your free Dechra account", "Sign up for your free Dechra account")</h2> 55 </div> 56 </div> 57 <div class="row"> 58 <div class="col-12 col-md-6 col-lg-6 pt-2 pt-lg-0"> 59 <h4 class="mb-1">@Translate("1. Basic info", "1. Basic info")</h4> 60 <div class="row"> 61 <div class="col-12 form-fields"> 62 <input maxlength="250" class="form-control required" placeholder="@Translate("First name", "First name")" type="text" name="UserManagement_Form_FirstName" value="" autocomplete="off" /> 63 </div> 64 </div> 65 <div class="row"> 66 <div class="col-12 form-fields"> 67 <input maxlength="250" class="form-control required" placeholder="@Translate("Surname", "Surname")" type="text" name="UserManagement_Form_LastName" value="" autocomplete="off" /> 68 </div> 69 </div> 70 71 @if(jobTitleOptions.Length > 0) 72 { 73 <div class="row"> 74 <div class="col-12 form-fields"> 75 <select class="form-control required" name="CustomField.AccessUser_AccessUser_jobtitle"> 76 <option value="" selected hidden>@Translate("Job title","Job title")</option> 77 @foreach (string jobTitleOption in jobTitleOptions) { 78 79 string jobTitleOptionTranslated = Translate("Dechra_Modules_UserManagement_JobTitle_Option_" + jobTitleOption.Replace(" ", ""), jobTitleOption); 80 81 <option value="@jobTitleOption"> 82 @jobTitleOptionTranslated 83 </option> 84 } 85 </select> 86 </div> 87 </div> 88 } 89 90 <div class="row"> 91 <div class="col-12 form-fields"> 92 <input maxlength="250" class="form-control email required" placeholder="@Translate("E-mail", "E-mail")" type="email" name="UserManagement_Form_Email" value="" autocomplete="off" /> 93 </div> 94 </div> 95 <div class="row"> 96 <div class="col-12 form-fields"> 97 <input maxlength="250" class="form-control required" placeholder="@Translate("Username", "Username")" type="text" name="UserManagement_Form_UserName" value="" autocomplete="off" /> 98 </div> 99 </div> 100 <div class="row"> 101 <div class="col-12 form-fields"> 102 <input maxlength="250" class="form-control required" placeholder="@Translate("Password", "Password")" type="password" name="UserManagement_Form_NewPassword" value="" autocomplete="off" /> 103 </div> 104 </div> 105 <div class="row"> 106 <div class="col-12 form-fields"> 107 <input maxlength="250" class="form-control required" placeholder="@Translate("Confirm password", "Confirm password")" type="password" name="UserManagement_Form_NewPasswordConfirm" value="" autocomplete="off" /> 108 </div> 109 </div> 110 </div> 111 <div class="col-12 col-md-6 col-lg-6 pt-2 pt-lg-0"> 112 <h4 class="mb-1">@Translate("2. Practice info", "2. Practice info")</h4> 113 @if(practiceTypeOptions.Length > 0) 114 { 115 <div class="row"> 116 <div class="col-12 form-fields"> 117 <select class="form-control required" name="CustomField.AccessUser_AccessUser_practicetype"> 118 <option value="" selected hidden>@Translate("Practice type","Practice type")</option> 119 @foreach (string practiceTypeOption in practiceTypeOptions) { 120 121 string praticeTypeOptionTranslated = Translate("Dechra_Modules_UserManagement_PraticeType_Option_" + practiceTypeOption.Replace(" ", ""), practiceTypeOption); 122 123 <option value="@practiceTypeOption"> 124 @praticeTypeOptionTranslated 125 </option> 126 } 127 </select> 128 </div> 129 </div> 130 } 131 <div class="row"> 132 <div class="col-12 form-fields"> 133 <input class="form-control required" placeholder="@Translate("Practice name","Practice name")" type="text" name="UserManagement_Form_Company" value="" autocomplete="off" /> 134 </div> 135 </div> 136 @if(enabledUserFields.Contains("VetRegistrationNumber")) 137 { 138 <div class="row"> 139 <div class="col-12 form-fields"> 140 <input class="form-control required" placeholder="@Translate("Vet registration number","Vet registration number")" type="text" name="CustomField.AccessUser_AccessUser_vetregistrationnumber" value="" autocomplete="off" /> 141 </div> 142 </div> 143 } 144 @if(enabledUserFields.Contains("Qualifications")) 145 { 146 <div class="row"> 147 <div class="col-12 form-fields"> 148 <textarea class="form-control" name="CustomField.AccessUser_AccessUser_qualifications" placeholder="@Translate("Qualifications","Qualifications")" rows="3"></textarea> 149 </div> 150 </div> 151 } 152 <div class="row"> 153 <div class="col-12 form-fields"> 154 <select data-current-country-code="@countryCode" class="js-dechra-user-country-selector form-control required" name="UserManagement_Form_Country"> 155 @foreach(KeyValuePair<string,string> country in CountryUiService.GetAllCountries()) 156 { 157 <option value="@country.Key" @(country.Key.Equals(countryCode)?"selected":"")>@country.Value</option> 158 } 159 </select> 160 @if(!string.IsNullOrEmpty(HttpContext.Current.Request["new"]) && HttpContext.Current.Request["new"] == "warning") 161 { 162 <div class="js-dechra-country-warning-message dechra-country-warning-message d-none alert alert-primary"> 163 <u>DISCLAIMER</u>: 164 <br>The selected country does not match the current website country. You may not receive important information in regards to your own country legislation. 165 </div> 166 } 167 </div> 168 </div> 169 <div class="row"> 170 <div class="col-12 form-fields"> 171 <input class="form-control required" placeholder="@Translate("Address","Address")" type="text" name="UserManagement_Form_Address" value="" autocomplete="off" /> 172 </div> 173 </div> 174 <div class="row"> 175 <div class="col-8 form-fields"> 176 <input class="form-control required" placeholder="@Translate("City","City")" type="text" name="UserManagement_Form_City" value="" autocomplete="off" /> 177 </div> 178 <div class="col-4 form-fields"> 179 <input class="form-control required" placeholder="@Translate("Zipcode","Zipcode")" type="text" name="UserManagement_Form_Zip" value="" autocomplete="off" /> 180 </div> 181 </div> 182 <div class="row"> 183 <div class="col-12 form-fields form-check"> 184 <h4 class="mt-1 mb-0">@Translate("Newsletter","Newsletter")</h4> 185 <p class="mb-1 small">@Translate("We would like to keep you up-to-date about educational courses and events, exciting offers, product and service information and customer surveys.", "We would like to keep you up-to-date about educational courses and events, exciting offers, product and service information and customer surveys.")</p> 186 <label class="form-check-label"> 187 <input class="form-check-input" type="checkbox" name="CustomField.AccessUser_AccessUser_dechragroupsharing" value="1"> <small>@Translate("Receive product and service news","Receive product and service news")</small> 188 </label> 189 @if(!string.IsNullOrEmpty(policyPageId)) 190 { 191 <p class="mt-1 mb-0 small"><a href="/Default.aspx?ID=@policyPageId" target="_blank">@Translate("We treat your personal data with respect. You can read about how we secure and use your data in our Privacy Promise.", "We treat your personal data with respect. You can read about how we secure and use your data in our Privacy Promise.")</a></p> 192 } 193 </div> 194 </div> 195 <div class="row"> 196 <div class="col-12 text-right form-fields"> 197 <input type="hidden" class="js-hiddenRecaptcha hiddenRecaptcha required" name="hiddenRecaptcha" id="hiddenRecaptcha"> 198 <div class="g-recaptcha d-flex justify-content-end" data-sitekey="6Le8zhkTAAAAAKE35lYz9HscVvlPWq6pb88WjoqX"></div> 199 </div> 200 </div> 201 <div class="row"> 202 <div class="col-12 text-right"> 203 <button class="btn btn-primary" type="submit">@Translate("Register", "Register")</button> 204 </div> 205 </div> 206 </div> 207 </div> 208 @GetValue("UserManagement:User.FormEnd") 209 </div>
keyboard_arrow_up