Online support

Hjælp os til at yde dig en endnu hurtigere og bedre service.

Brug nedenstående formular til problembeskrivelse og medsend billede/ video direkte til vores serviceafdeling. Så vender vi tilbage med support.

Error executing template "../../Admin/Module/BasicForms/DefaultFormTemplate.cshtml"
System.ArgumentException: Object type cannot be converted to target type.
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CleanupHelper.Init(AppDomain domain, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.InitHelper.CreateHelper()
   at RazorEngine.Compilation.ExecutionContextLessThread.CallHelperSafeHelper`2.AsAction()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallFunc[O](Func`1 f)
   at RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault)
   at RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   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 @using System.Web.Mvc; 3 @{ 4 string formCssClass = GetString("Form.CssClass"); 5 string formSystemFields = GetString("Form.SystemFields"); 6 bool formLabelBold = GetBoolean("Form.LabelBold"); 7 bool formLabelOverField = GetBoolean("Form.LabelOverField"); 8 string formId = GetString("Form.HtmlId"); 9 string formOnSubmit = GetString("Form.OnSubmit"); 10 string formSpamScript = GetString("Form.SpamScript"); 11 string formAction = GetString("Form.Action"); 12 int formColumnShiftFormFieldID = GetInteger("Form.ColumnShiftFormFieldID"); 13 string formLabelRequired = GetString("Form.LabelRequired"); 14 15 int formMaxSubmits = GetInteger("Form.MaxSubmits"); 16 int formSubmitCount = GetInteger("Form.SubmitCount"); 17 string formMaxSubmitsReachedText = GetString("Form.MaxSubmitsReachedText"); 18 19 string labelStyle = string.Empty; 20 if (formLabelBold) 21 { 22 labelStyle = ".formtable .labelCell label{font-weight:bold;}"; 23 } 24 } 25 26 27 @{ 28 if (formMaxSubmits > 0 && formSubmitCount >= formMaxSubmits) 29 { 30 @formMaxSubmitsReachedText 31 } 32 else 33 { 34 35 36 <style type="text/css"> 37 .formtable td { 38 padding: 3px; 39 } 40 41 .formtable .columnCell { 42 vertical-align: top; 43 } 44 45 .formtable .labelCell { 46 vertical-align: top; 47 padding-right: 10px; 48 } 49 50 51 .formtable .descriptionCell { 52 font-size: 0.8em; 53 opacity: 0.8; 54 padding: 0px; 55 padding-left: 3px; 56 padding-bottom: 5px; 57 max-height: 0.8em; 58 line-height: 1.0em; 59 } 60 61 .formtable input[type=text], 62 .formtable input[type=password], 63 .formtable textarea { 64 min-width: 250px; 65 } 66 </style> 67 <style type="text/css"> 68 @labelStyle 69 </style> 70 71 <form method="post" action="@formAction" enctype="multipart/form-data" class="@formCssClass" id="@formId" onsubmit="@formOnSubmit"> 72 @formSystemFields 73 <table class="formtable"> 74 @if (formColumnShiftFormFieldID > 0) 75 { 76 @GetStartTable(); 77 } 78 79 @foreach (LoopItem field in GetLoop("Fields")) 80 { 81 int fieldId = field.GetInteger("Field.ID"); 82 string fieldHtmlId = field.GetString("Field.HtmlId"); 83 string fieldName = field.GetString("Field.Name"); 84 string fieldControl = field.GetString("Field.Control"); 85 string fieldDescription = field.GetString("Field.Description"); 86 string fieldType = field.GetString("Field.Type"); 87 bool fieldIsButton = field.GetBoolean("Field.IsButton"); 88 bool fieldIsOther = field.GetBoolean("Field.IsOther"); 89 bool fieldRequired = field.GetBoolean("Field.Required"); 90 91 string requiredImage = string.Empty; 92 if (fieldRequired && !String.IsNullOrEmpty(formLabelRequired)) 93 { 94 requiredImage = String.Format("<img src=\"/Files/{0}\">", formLabelRequired); 95 } 96 97 string fieldActivityId = field.GetString("Field.Activity.Id"); 98 string fieldActivityName = field.GetString("Field.Activity.Name"); 99 string fieldActivityDescription = field.GetString("Field.Activity.Description"); 100 101 if (formLabelOverField) 102 { 103 if (!fieldIsButton && !fieldIsOther && fieldType != "Hidden") 104 { 105 <tr class="labelRow"> 106 <td class="labelCell"><label for="@fieldHtmlId">@Translate(fieldName, fieldName) @requiredImage</label></td> 107 </tr> 108 } 109 <tr class="fieldRow"> 110 <td>@fieldControl</td> 111 </tr> 112 <tr class="descriptionRow"> 113 <td class="descriptionCell"><small>@Translate(fieldDescription, fieldDescription)</small></td> 114 </tr> 115 116 if (!string.IsNullOrEmpty(fieldActivityId)) 117 { 118 <tr class="consentRow"> 119 <td> 120 <strong>@fieldActivityName</strong> 121 <div>@fieldActivityDescription</div> 122 </td> 123 </tr> 124 } 125 } 126 else 127 { 128 <tr class="fieldRow"> 129 <td class="labelCell"> 130 @if (!fieldIsButton && !fieldIsOther && fieldType != "Checkbox" && fieldType != "Hidden") 131 {<label for="@fieldHtmlId">@Translate(fieldName, fieldName) @requiredImage</label>} 132 </td> 133 <td>@fieldControl @if (fieldType == "Checkbox") 134 { <label for="@fieldHtmlId">@Translate(fieldName, fieldName) @requiredImage</label>}</td> 135 </tr> 136 <tr class="descriptionRow"> 137 <td class="descriptionCell"></td> 138 <td class="descriptionCell"><small>@Translate(fieldDescription, fieldDescription)</small></td> 139 </tr> 140 141 if (!string.IsNullOrEmpty(fieldActivityId)) 142 { 143 <tr class="consentRow"> 144 <td></td> 145 <td> 146 <strong>@fieldActivityName</strong> 147 <div>@fieldActivityDescription</div> 148 </td> 149 </tr> 150 } 151 152 } 153 if (formColumnShiftFormFieldID == fieldId) 154 { 155 @GetShiftColumn(); 156 } 157 } 158 159 @if (formColumnShiftFormFieldID > 0) 160 { 161 @GetEndTable(); 162 } 163 </table> 164 </form> 165 } 166 } 167 @functions { 168 private string GetStartTable() 169 { 170 return "<tr><td class=\"columnCell\"><table class=\"firstColumn\">"; 171 } 172 173 private string GetShiftColumn() 174 { 175 return "</table></td><td class=\"columnCell\"><table class=\"secondColumn\">"; 176 } 177 178 private string GetEndTable() 179 { 180 return "</table></td></tr>"; 181 } 182 }

Mere orden · Bedre arbejdsmiljø · Øget indtjening

@2017 - PALOMAT®