Download beeldmateriaal

Vul onderstaande gegevens in en klik op de button om de foto te downloaden.

Error executing template "Designs/Alkmaar Marketing/Forms/Form/BeeldbankDownload.cshtml"
System.ArgumentException: String parameter itemId cannot be null or empty
Parameter name: itemId
   at Dynamicweb.Core.Ensure.Argument.NotNullOrEmpty(String value, String parameterName)
   at Dynamicweb.Content.ItemService.GetItem(String itemType, String itemId) in E:\Agent\_work\169\s\06 - Dynamicweb Host\Dynamicweb\Dynamicweb-9.9\Dynamicweb\Content\ItemService.cs:line 35
   at CompiledRazorTemplates.Dynamic.RazorEngine_fa1b6dd0e9e6462c873c8008257620c2.Execute() in D:\virtual_hosts\alkmaarprachtstad.nl\files\Templates\Designs\Alkmaar Marketing\Forms\Form\BeeldbankDownload.cshtml:line 9
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, ITemplateSource templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate() in E:\Agent\_work\169\s\06 - Dynamicweb Host\Dynamicweb\Dynamicweb-9.9\Dynamicweb\Rendering\Template.cs:line 902

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @{ 3 string formCssClass = GetString("Form.CssClass"); 4 string formSystemFields = GetString("Form.SystemFields"); 5 string formId = GetString("Form.HtmlId"); 6 string formOnSubmit = GetString("Form.OnSubmit"); 7 string formAction = GetString("Form.Action"); 8 var domain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 9 var item = Dynamicweb.Services.Items.GetItem("Pers_Download", System.Web.HttpContext.Current.Request.QueryString.Get("download")); 10 11 var imgWeb = Dynamicweb.Services.Items.GetItem("Pers_Image", item["Image_Web"].ToString()); 12 var imgOriginal = Dynamicweb.Services.Items.GetItem("Pers_Image", item["Image_Original"].ToString()); 13 14 var imgWebSrc = imgWeb["Image"].ToString(); 15 var imgWebDescription = imgWeb["Description"].ToString(); 16 var imgWebResolution = imgWeb["Resolution"].ToString(); 17 18 var imgOriginalSrc = imgOriginal["Image"].ToString(); 19 var imgOriginalDescription = imgOriginal["Description"].ToString(); 20 var imgOriginalResolution = imgOriginal["Resolution"].ToString(); 21 } 22 23 <div class="row"> 24 <div class="col-xs-12 col-sm-11 col-sm-offset-1"> 25 <form method="post" action="@formAction" enctype="multipart/form-data" class="@formCssClass beeldbankform form__container" id="@formId" onsubmit="@formOnSubmit"> 26 @formSystemFields 27 @foreach (LoopItem field in GetLoop("Fields")) 28 { 29 string fieldHtmlId = field.GetString("Field.HtmlId"); 30 string fieldName = field.GetString("Field.Name"); 31 string fieldControl = field.GetString("Field.Control"); 32 bool fieldIsHidden = field.GetString("Field.Type").Equals("Hidden"); 33 bool fieldRequired = field.GetBoolean("Field.Required"); 34 string fieldType = field.GetString("Field.Type"); 35 string fieldCCssClass = field.GetString("Field.CssClass"); 36 37 if (fieldIsHidden) 38 { 39 if(fieldHtmlId == "Naamfoto") { 40 <input type="hidden" id="Naamfoto" name="Naamfoto" value="@imgOriginalDescription"> 41 } else if(fieldHtmlId == "Foto") { 42 <input type="hidden" id="Foto" name="Foto" value="@domain@imgOriginalSrc"> 43 } else { 44 @fieldControl 45 } 46 } 47 else 48 { 49 if (fieldType == "TextInput") 50 { 51 <div class="row form__group"> 52 <div class="col-xs-12 col-sm-3"><label class="form__label" for="@fieldHtmlId">@fieldName @(fieldRequired ? "*" : "" )</label></div> 53 <div class="col-xs-12 col-sm-7"><input type="text" id="@fieldHtmlId" name="@fieldHtmlId" @(fieldRequired ? "required" : "" ) class="form__input" /></div> 54 </div> 55 } 56 else if (fieldType == "Tel") 57 { 58 <div class="row form__group"> 59 <div class="col-xs-12 col-sm-3"><label class="form__label" for="@fieldHtmlId">@fieldName @(fieldRequired ? "*" : "" )</label></div> 60 <div class="col-xs-12 col-sm-7"><input type="tel" id="@fieldHtmlId" name="@fieldHtmlId" @(fieldRequired ? "required" : "" ) class="form__input" /></div> 61 </div> 62 } 63 else if (fieldType == "Email") 64 { 65 <div class="row form__group"> 66 <div class="col-xs-12 col-sm-3"><label class="form__label" for="@fieldHtmlId">@fieldName @(fieldRequired ? "*" : "" )</label></div> 67 <div class="col-xs-12 col-sm-7"><input type="email" id="@fieldHtmlId" name="@fieldHtmlId" @(fieldRequired ? "required" : "" ) class="form__input" /></div> 68 </div> 69 } 70 else if (fieldType == "Textarea") 71 { 72 <div class="row form__group"> 73 <div class="col-xs-12 col-sm-3"><label class="form__label">@fieldName @(fieldRequired ? "*" : "" )</label></div> 74 <div class="col-xs-12 col-sm-7"><textarea class="form__textarea" id="@fieldHtmlId" name="@fieldHtmlId" @(fieldRequired ? "required" : "" )></textarea></div> 75 </div> 76 } 77 else if (fieldType == "Select") 78 { 79 <div class="row form__group"> 80 <div class="col-xs-12 col-sm-3"><label class="form__label">@fieldName @(fieldRequired ? "*" : "" )</label></div> 81 <div class="col-xs-12 col-sm-7"> 82 <select id="@fieldHtmlId" name="@fieldHtmlId" class="form__input @fieldCCssClass"> 83 @foreach (var o in field.GetLoop("Options")) 84 { 85 <option value="@o.GetString("Option.Value")">@o.GetString("Option.Text")</option> 86 } 87 </select> 88 </div> 89 </div> 90 } 91 else if (fieldType == "Radio") 92 { 93 <div class="row form__group"> 94 <div class="col-xs-12 col-sm-3"><label class="form__label">@fieldName @(fieldRequired ? "*" : "" )</label></div> 95 <div class="col-xs-12 col-sm-7"> 96 <label class="form__radio-label"> 97 <input class="form__radio-input" type="radio" name="@fieldHtmlId" value="Heer" checked /> 98 <span>Heer</span> 99 </label> 100 <label class="form__radio-label"> 101 <input class="form__radio-input" type="radio" name="@fieldHtmlId" value="Mevrouw" /> 102 <span>Mevrouw</span> 103 </label> 104 </div> 105 </div> 106 } 107 else if (fieldType == "CheckBox") 108 { 109 <div class="row form__group"> 110 <div class="col-xs-12 col-sm-offset-5 col-sm-7"> 111 <label class="checkbox__label"> 112 <input class="checkbox__input" type="checkbox" name="@fieldHtmlId" id="@fieldHtmlId" /> 113 <span class="checkbox__span">@fieldName</span> 114 </label> 115 </div> 116 </div> 117 } 118 else if (fieldType == "File") 119 { 120 <div class="row form__group"> 121 <div class="col-xs-12 col-sm-3"><label class="form__label">@fieldName @(fieldRequired ? "*" : "" )</label></div> 122 <div class="col-xs-12 col-sm-7"> 123 @fieldControl 124 <p class="form__description">@field.GetString("Field.Description")</p> 125 </div> 126 </div> 127 } 128 else if (fieldType == "Submit") 129 { 130 } 131 else 132 { 133 <div class="row form__group"> 134 <div class="col-xs-12 col-sm-5"> 135 @fieldControl 136 </div> 137 </div> 138 } 139 } 140 } 141 142 <div class="row paragraph__content "> 143 <div class="col-lg-12"> 144 <header class=""> 145 <h2 class="paragraph__header">Download foto "@imgOriginalDescription"</h2> 146 </header> 147 <div class="row"> 148 <div class="col-xs-12 col-sm-6 text-center"> 149 <input class="btn btn-primary form form-control__button beeldbank__submit-btn" type="submit" value="@Translate("Download.Link.Web", "Download voor web")" data-src="@imgWebSrc" /> 150 <p>(@imgWebResolution)</p> 151 </div> 152 153 <div class="col-xs-12 col-sm-6 text-center"> 154 <input class="btn btn-primary form form-control__button beeldbank__submit-btn" type="submit" value="@Translate("Download.Link.Original", "Download origineel")" data-src="@imgOriginalSrc" /> 155 <p>(@imgOriginalResolution)</p> 156 </div> 157 </div> 158 </div> 159 </div> 160 </form> 161 </div> 162 </div> 163 164 <script> 165 document.addEventListener('DOMContentLoaded', function () { 166 var buttons = document.querySelectorAll(".beeldbank__submit-btn"); 167 for(var i = 0; i < buttons.length; i++) { 168 buttons[i].addEventListener('click', function(event) { 169 var form = document.querySelectorAll(".beeldbankform"); 170 var isValid = form[0].checkValidity(); 171 if(isValid) { 172 window.open(event.target.dataset.src); 173 }; 174 }); 175 }; 176 }); 177 </script>

Blijf up to date over alles wat er te doen is in Alkmaar!

Wij zullen je e-mail adres alleen gebruiken voor onze maandelijkse nieuwsbrief.