Kontakt Service Support

Udfyld formularen og hjælp os til at yde dig en endnu hurtigere og bedre service.

Brug nedenstående formular til at beskrive din udfordring og medsend billeder/video og dokumenter direkte til Service Support. Vi kontakter dig hurtigst muligt herefter.

Error executing template "Forms/Form/DefaultForm.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 @{ 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 17 18 @{ 19 if (formMaxSubmits > 0 && formSubmitCount >= formMaxSubmits) 20 { 21 @GetString("Form.MaxSubmitsReachedText") 22 } 23 else 24 { 25 <style type="text/css"> 26 .formtable td { 27 padding: 3px; 28 } 29 30 .formtable .columnCell { 31 vertical-align: top; 32 } 33 34 .formtable .labelCell { 35 vertical-align: top; 36 padding-right: 10px; 37 } 38 39 40 .formtable .descriptionCell { 41 font-size: 0.8em; 42 opacity: 0.8; 43 padding: 0px; 44 padding-left: 3px; 45 padding-bottom: 5px; 46 max-height: 0.8em; 47 line-height: 1.0em; 48 } 49 50 .formtable input[type=text], 51 .formtable input[type=password], 52 .formtable textarea { 53 min-width: 250px; 54 } 55 @if (formLabelBold) 56 { 57 <text>.formtable .labelCell label {font-weight:bold;}</text> 58 } 59 </style> 60 61 <form method="post" action="@formAction" enctype="multipart/form-data" class="@formCssClass" id="@formId" onsubmit="@formOnSubmit"> 62 @formSystemFields 63 <table class="formtable"> 64 @if (formColumnShiftFormFieldID > 0) 65 { 66 @GetStartTable(); 67 } 68 69 @foreach (LoopItem field in GetLoop("Fields")) 70 { 71 int fieldId = field.GetInteger("Field.ID"); 72 string fieldHtmlId = field.GetString("Field.HtmlId"); 73 string fieldName = field.GetString("Field.Name"); 74 string fieldControl = field.GetString("Field.Control"); 75 string fieldDescription = field.GetString("Field.Description"); 76 bool fieldIsButton = field.GetBoolean("Field.IsButton"); 77 bool fieldIsOther = field.GetBoolean("Field.IsOther"); 78 bool fieldRequired = field.GetBoolean("Field.Required"); 79 80 string requiredImage = string.Empty; 81 if (fieldRequired && !String.IsNullOrEmpty(formLabelRequired)) 82 { 83 requiredImage = String.Format("<img src=\"/Files/images/{0}\">", formLabelRequired); 84 } 85 86 if (formLabelOverField) 87 { 88 if (!fieldIsButton && !fieldIsOther) 89 { 90 <tr class="labelRow"> 91 <td class="labelCell"> 92 <label for="@fieldHtmlId">@fieldName @requiredImage</label> 93 </td> 94 </tr> 95 } 96 <tr class="fieldRow"> 97 <td>@fieldControl</td> 98 </tr> 99 <tr class="descriptionRow"> 100 <td class="descriptionCell"><small>@fieldDescription</small></td> 101 </tr> 102 } 103 else 104 { 105 <tr class="fieldRow"> 106 <td class="labelCell"> 107 @if (!fieldIsButton && !fieldIsOther) 108 { 109 <label for="@fieldHtmlId">@fieldName @requiredImage</label> 110 } 111 </td> 112 <td>@fieldControl</td> 113 </tr> 114 <tr class="descriptionRow"> 115 <td class="descriptionCell"></td> 116 <td class="descriptionCell"><small>@fieldDescription</small></td> 117 </tr> 118 } 119 if (formColumnShiftFormFieldID == fieldId) 120 { 121 @GetShiftColumn(); 122 } 123 } 124 @if (formColumnShiftFormFieldID > 0) 125 { 126 @GetEndTable(); 127 } 128 </table> 129 </form> 130 } 131 } 132 133 @functions { 134 private string GetStartTable() 135 { 136 return "<tr><td class=\"columnCell\"><table class=\"firstColumn\">"; 137 } 138 139 private string GetShiftColumn() 140 { 141 return "</table></td><td class=\"columnCell\"><table class=\"secondColumn\">"; 142 } 143 144 private string GetEndTable() 145 { 146 return "</table></td></tr>"; 147 } 148 }

Kontakt os

Kent R. Thomassen

Kent Ruseng Thomassen

Head of Service Support
+4522650206

krt@bila.dk

Vælg løsning

Se hvordan vi optimerede hos vores eksisterende kunder