Error executing template "Designs/ncnielsen/Forms/Form/order-salesmaterials.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_959db1e900224c319de0cd646ccd6ae1.Execute() in D:\dynamicweb.net\Solutions\Gotcha\ncn.dw9.dynamicweb-cms.com\files\Templates\Designs\ncnielsen\Forms\Form\order-salesmaterials.cshtml:line 29
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 @if (System.Web.HttpContext.Current.Request.QueryString["thankyou"] != null) {
2 <div>
3 @SnippetStart("ProductOrderSalesMaterials")
4 @{
5 int thankYouParagraphID = -1;
6
7 try {
8 thankYouParagraphID = Convert.ToInt32(Pageview.Area.Item["OrderSalesMaterials__ThankYouParagraph"]);
9 } catch {
10
11 }
12
13 if (thankYouParagraphID != -1) {
14 <text>@RenderParagraphContent(thankYouParagraphID)</text>
15 }
16 }
17 @SnippetEnd("ProductOrderSalesMaterials")
18 </div>
19 } else {
20 <text>
21 @SnippetStart("ProductOrderSalesMaterials")
22 <h2 id="orderSalesMaterials"><span><span>@Translate("Translate_Bestil_salgsmateriale")</span></span></h2><p>@Translate("Translate_Bestil_salgsmateriale_beskrivelse")</p>
23 @GetString("Form.FormStart").Replace("<form","<form id=\"orderSalesMaterialsForm\"")
24
25
26 <div class="fieldset"><input type="text" placeholder='@Translate("Translate_" + GetString("Form.Field.Virksomhed.Placeholder"))' id='@GetString("Form.Field.Virksomhed.HtmlId")' name='@GetString("Form.Field.Virksomhed.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /></div><div class="fieldset"><input type="text" placeholder='@Translate("Translate_" + GetString("Form.Field.Kontaktperson.Placeholder"))' id='@GetString("Form.Field.Kontaktperson.HtmlId")' name='@GetString("Form.Field.Kontaktperson.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /><input type="email" placeholder='@Translate("Translate_" + GetString("Form.Field.Email.Placeholder"))' id='@GetString("Form.Field.Email.HtmlId")' name='@GetString("Form.Field.Email.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /><input type="tel" placeholder='@Translate("Translate_" + GetString("Form.Field.Telefon.Placeholder"))' id='@GetString("Form.Field.Telefon.HtmlId")' name='@GetString("Form.Field.Telefon.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /></div><div class="fieldset"><input type="text" placeholder='@Translate("Translate_" + GetString("Form.Field.Adresse.Placeholder"))' id='@GetString("Form.Field.Adresse.HtmlId")' name='@GetString("Form.Field.Adresse.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /><input type="number" placeholder='@Translate("Translate_" + GetString("Form.Field.Postnr.Placeholder"))' id='@GetString("Form.Field.Postnr.HtmlId")' name='@GetString("Form.Field.Postnr.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /><input type="text" placeholder='@Translate("Translate_" + GetString("Form.Field.By.Placeholder"))' id='@GetString("Form.Field.By.HtmlId")' name='@GetString("Form.Field.By.HtmlId")' autocomplete="off" autocorrect="off" spellcheck="false" required /></div><div class="fieldset"><textarea placeholder='@Translate("Translate_" + GetString("Form.Field.BemAerkninger.Placeholder"))' id='@GetString("Form.Field.BemAerkninger.HtmlId")' name='@GetString("Form.Field.BemAerkninger.HtmlId")' autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" required></textarea></div><button type="submit" class="button button-primary"><span class="text">@Translate("Translate_Bestil_salgsmateriale")</span></button>
27 @GetString("Form.SystemFields")
28 @{
29 string productName = System.Web.HttpContext.Current.Items["currentProductName"].ToString();
30 }
31 <input type="hidden" name="Produkt" value="@productName" /><input type="hidden" name="formSubmitAction" value="page" /><input type="hidden" name="formSubmitPageAfterSave" value='@Pageview.SearchFriendlyUrl@("?thankyou=1#downloadList")' />
32 @GetString("Form.FormEnd")
33 @SnippetEnd("ProductOrderSalesMaterials")
34 </text>
35 }