我需要有一个umbraco 7表单的自定义视图,它具有特殊的列布局,但我的问题是我无法使用MySql
我正在使用
呈现表单Sub Rec()
Dim fileNames As Object, errCheck As Boolean
Dim ws As Worksheet, wks As Worksheet, wksSummary As Worksheet
Dim y As Range, intRow As Long, i As Integer
' Turn off screen updating and automatic calculation
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
'get user input for files to search
Set fileNames = CreateObject("Scripting.Dictionary")
errCheck = UserInput.FileDialogDictionary(fileNames)
If errCheck Then
Exit Sub
End If
For Each Key In fileNames 'loop through the dictionary
On Error Resume Next
Workbooks.OpenText Filename:=filenames(Key), _
DataType:=xlDelimited, _
Other:=True, _
OtherChar:="|"
On Error GoTo 0 ' or your custom error handler
Next 'End of the fileNames loop
Set fileNames = Nothing
' Reset system settings
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = True
.Visible = True
End With
End Sub
在我的Form.cshtml中,我想插入一个umbraco字段.GetPropertyValue("formHeader")
但我似乎无法让它发挥作用
@Umbraco.RenderMacro("FormsRenderForm", new { FormGuid = "6189b8c2-980a-4f02-bcec-33b170020a22" })
将返回
加载部分视图脚本时出错(文件: 〜/查看/ MacroPartials / InsertUmbracoForm.cshtml)
这是否可能,我正在思考它的方式?
我正在使用Umbraco Forms
答案 0 :(得分:1)
我认为UmbracoTemplatePage
不起作用,因为FormViewModel
不会从Umbraco.Web.Models.RenderModel
继承。请尝试在Form.cshtml中使用UmbracoViewPage<T>
:
@inherits UmbracoViewPage<Umbraco.Forms.Mvc.Models.FormViewModel>
然后,您可以使用UmbracoHelper
检索当前分配的内容项:
var currentPage = Umbraco.AssignedContentItem;
这会为您提供当前页面IPublishedContent
,以便您可以正常获取字段值。
var formHeader = currentPage.GetPropertyValue("formHeader");
答案 1 :(得分:0)
您必须检查app_data / Logs / UmbracoTraceLog.txt局部视图中的问题。