Error executing template "Designs/Pronghorn/Forms/Form/SendBasketForm.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_6a34cfc5e4ed47bba8d588679e9f55af.Execute() in D:\web\pronghorn2022.dk\Pronghorn.Website\Files\Templates\Designs\Pronghorn\Forms\Form\SendBasketForm.cshtml:line 16
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.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @{ 2 string formCssClass = GetString("Form.CssClass"); 3 string formSystemFields = GetString("Form.SystemFields"); 4 bool formLabelBold = GetBoolean("Form.LabelBold"); 5 bool formLabelOverField = GetBoolean("Form.LabelOverField"); 6 string formId = GetString("Form.HtmlId"); 7 string formOnSubmit = GetString("Form.OnSubmit"); 8 string formSpamScript = GetString("Form.SpamScript"); 9 string formAction = GetString("Form.Action"); 10 int formColumnShiftFormFieldID = GetInteger("Form.ColumnShiftFormFieldID"); 11 string formLabelRequired = GetString("Form.LabelRequired"); 12 13 int formMaxSubmits = GetInteger("Form.MaxSubmits"); 14 int formSubmitCount = GetInteger("Form.SubmitCount"); 15 16 var cartId = Dynamicweb.Ecommerce.Common.Context.Cart.Id; 17 var cartSecret = new Dynamicweb.Ecommerce.Orders.OrderService().GetOrder(cartId).Secret; 18 var basketURL = "http://" + GetGlobalValue("Global:Request.Host") + "/Default.aspx?AreaID=" + GetGlobalValue("Global:Area.ID") + "&ID=" + @GetGlobalValue("Global:eCommerce.CartPageID") + "&CartCmd=loadorder&LoadingOrderId=" + cartId + "&LoadingOrderSecret=" + cartSecret; 19 20 } 21 22 @{ 23 if (formMaxSubmits > 0 && formSubmitCount >= formMaxSubmits) 24 { 25 @GetString("Form.MaxSubmitsReachedText") 26 } 27 else 28 { 29 <style type="text/css"> 30 31 input[type="text"], input[type="tel"] { 32 line-height: unset; 33 } 34 35 form.basketForm div { 36 margin-top: 5px; 37 margin-bottom: 5px; 38 } 39 40 form.basketForm input[type="text"], form.basketForm input[type="tel"], form.basketForm input[type="email"], form.basketForm select, form.basketForm textarea { 41 width: 100%; 42 } 43 44 form.basketForm input[type="submit"] { 45 width: 100%; 46 } 47 48 form.basketForm input[type="checkbox"] { 49 width: 20px; 50 height: 20px; 51 margin-top: 5px; 52 } 53 54 div.col-xs-1{ 55 width:20px; 56 } 57 58 .no-padding { 59 padding: 0; 60 } 61 62 #zip input { 63 margin-left: 10px; 64 } 65 66 #zip label{ 67 margin-left: 10px; 68 } 69 70 #phone input { 71 margin-right: 10px; 72 } 73 </style> 74 75 <form method="post" action="@formAction" enctype="multipart/form-data" class="@formCssClass basketForm" id="basket-form" onsubmit="@formOnSubmit"> 76 @formSystemFields 77 78 @if (GetString("Form.Field.Email.SystemName") == "Email") 79 { 80 <div class="col-xs-12 input-group" id="email"> 81 <label for="Email">@GetString("Form.Field.Email.Name")</label> 82 @GetString("Form.Field.Email.Control") 83 </div> 84 } 85 86 @if (GetString("Form.Field.Counseling.SystemName") == "Counseling") 87 { 88 <div class="col-xs-12" id="counceling"> 89 <div class="col-xs-1 no-padding"> 90 @GetString("Form.Field.Counseling.Control") 91 </div> 92 <div class="col-xs-11"> 93 <strong>@GetString("Form.Field.Counseling.Description")</strong> 94 </div> 95 </div> 96 } 97 98 @if (GetString("Form.Field.Name.SystemName") == "Name") 99 { 100 <div class="col-xs-12" id="name"> 101 <label for="Name">@GetString("Form.Field.Name.Name")</label> 102 @GetString("Form.Field.Name.Control") 103 </div> 104 } 105106 <div class="col-xs-12 input-group"> 107 @if (GetString("Form.Field.Phone.SystemName") == "Phone") 108 { 109 <div class="col-xs-6 no-padding" id="phone"> 110 <label for="Phone">@GetString("Form.Field.Phone.Name")</label> 111 @GetString("Form.Field.Phone.Control") 112 </div> 113 } 114115 @if (GetString("Form.Field.Zip.SystemName") == "Zip") 116 { 117 <div class="col-xs-6 no-padding" id="zip"> 118 <label for="Zip">@GetString("Form.Field.Zip.Name")</label> 119 @GetString("Form.Field.Zip.Control") 120 </div> 121 } 122 </div> 123124 @if (GetString("Form.Field.Newsletter.SystemName") == "Newsletter") 125 { 126 <div class="col-xs-12" id="newsletter"> 127 <div class="col-xs-1 no-padding"> 128 @GetString("Form.Field.Newsletter.Control") 129 </div> 130 <div class="col-xs-11"> 131 <label for="Newsletter">@GetString("Form.Field.Newsletter.Name")</label> 132 </div> 133 </div> 134 } 135136 @if (GetString("Form.Field.DataPolicy.SystemName") == "DataPolicy") 137 { 138139 <div class="col-xs-12" id="data-policy-description"> 140 <i>@GetString("Form.Field.DataPolicy.Description")</i> 141 </div> 142143 <div class="col-xs-12" id="data-policy-section"> 144 <i>@GetString("Form.Field.DataPolicy.Control")</i> 145 </div> 146147 } 148149 @if (GetString("Form.Field.SubmitBasket.SystemName") == "SubmitBasket") 150 { 151 <div class="col-xs-12" id="submit"> 152 @GetString("Form.Field.SubmitBasket.Control") 153 </div> 154 } 155156 @if (GetString("Form.Field.BasketUrl.SystemName") == "BasketUrl") 157 { 158 <div class="col-xs-12" id="basket-url"> 159 @GetString("Form.Field.BasketUrl.Control") 160 </div> 161 } 162 </form> 163 } 164165 <script defer> 166 document.addEventListener("DOMContentLoaded", function () { 167 var hiddenBasketField = document.getElementById("BasketUrl"); 168 var basketUrl = '@basketURL'; 169 hiddenBasketField.value = basketUrl; 170 }); 171 </script> 172 }

Når du tilmelder dig accepterer du vores vilkår og betingelser, som du kan læse her