Error executing template "Designs/Rapido/UserManagement/CreateProfile/CreateAccountB2B_Custom.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_98f308fdb6024b02becbb1da6a60ccc1.Execute() in D:\DynamicWeb\Solutions\shop.click-entertainment.com\Files\Templates\Designs\Rapido\UserManagement\CreateProfile\CreateAccountB2B_Custom.cshtml:line 5
   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 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 3 @{ 4 string pageId = GetGlobalValue("Global:Page.ID"); 5 string customernumber = Dynamicweb.Frontend.PageView.Current().User.CustomerNumber; 6 string customerCurrency = Dynamicweb.Frontend.PageView.Current().User.Currency; 7 string customerCompany = Dynamicweb.Frontend.PageView.Current().User.Company; 8 string customerUniqueidentifier = Dynamicweb.Frontend.PageView.Current().User.CustomFieldValues.Where(x => x.CustomField.SystemName == "AccessUser_UniqueIdentifier").FirstOrDefault().Value.ToString(); ; 9 } 10 11 <h2 class="u-no-margin u-margin-bottom"> 12 <i class="fas fa-user-plus"></i> 13 @Translate("Create user account for") <br />@GetGlobalValue("Global:Extranet.CustomerNumber") @GetGlobalValue("Global:Extranet.Company") 14 </h2> 15 16 <form name="UserManagementEditForm" id="UserManagementEditForm" method="post" action="/Default.aspx?ID=@pageId"> 17 <input type="hidden" name="UserManagementForm" value="1"> 18 <input type="hidden" name="UserManagement_Form_CustomerNumber" value="@customernumber"> 19 <input type="hidden" name="UserManagement_Form_Currency" value="@customerCurrency"> 20 <input type="hidden" name="UserManagement_Form_Company" value="@customerCompany"> 21 <input type="hidden" name="CustomField.AccessUser_AccessUser_UniqueIdentifier" value="@customerUniqueidentifier"> 22 <div class="form__field-group dw-mod"> 23 <label for="UserManagement_Form_Name">@Translate("Name", "Name")</label> 24 <input type="text" class="u-full-width" name="UserManagement_Form_Name" id="UserManagement_Form_Name" value="@GetString("UserManagement:User.Name")" required /> 25 </div> 26 <div class="field-error dw-mod">@GetString("UserManagement:User.Name.Input.Error")</div> 27 28 <div class="form__field-group dw-mod"> 29 <label for="UserManagement_Form_Email">@Translate("Email") (@Translate("Username"))</label> 30 <input type="email" class="u-full-width" name="UserManagement_Form_Email" id="UserManagement_Form_Email" value="@GetString("UserManagement:User.Email")" required /> 31 </div> 32 <div class="field-error dw-mod">@GetString("UserManagement:User.Email.Input.Error")</div> 33 34 <div class="form__field-group dw-mod"> 35 <label for="UserManagement_Form_NewPassword">@Translate("Password", "Password")</label> 36 @GetString("UserManagement:User.NewPassword.Input").Replace("input ", "input class=\"u-full-width\"") 37 </div> 38 <div class="field-error dw-mod">@GetString("UserManagement:User.NewPassword.Input.Error")</div> 39 40 <div class="form__field-group dw-mod"> 41 <label for="UserManagement_Form_NewPasswordConfirm">@Translate("Confirm password", "Confirm password")</label> 42 @GetString("UserManagement:User.NewPasswordConfirm.Input").Replace("input ", "input class=\"u-full-width\"") 43 </div> 44 <div class="field-error dw-mod">@GetString("UserManagement:User.NewPasswordConfirm.Input.Error")</div> 45 <div class="form__field-group dw-mod"> 46 <label for="UserManagement_Form_Email">@Translate("Phone", "Phone")</label> 47 <input type="text" class="u-full-width" name="UserManagement_Form_Phone" id="UserManagement_Form_Phone" value="@GetString("UserManagement:User.Phone")" /> 48 </div> 49 <div class="field-error dw-mod">@GetString("UserManagement:User.Phone.Input.Error")</div> 50 51 <div class="form__field-group dw-mod"> 52 @GetString("UserManagement:User.EmailAllowed.Input") 53 <label for="UserManagement_Form_EmailAllowed">@GetString("UserManagement:User.EmailAllowed.Activity.Description").Replace("<p>", "").Replace("</p>","")</label> 54 </div> 55 56 <button type="submit" class="btn btn--primary dw-mod" id="submitter" onclick="Buttons.LockButton(event)">@Translate("Create your new account")</button> 57 </form> 58