I have a small issue when rendering a contour form that the razor code in the view files is rendered as whitespace. This FieldType.Textfield.cshtml view is modified slightly but it's the same problem with the original:
This is bloody weird. If I remove the offending @model line, save the .cshtml, refresh the page, reinsert the line, save the .cshtml and refresh the page, it works! I have to the same over again on each FieldType.*.cshtml file though.
EDIT: Actually that wasn't enough. You have to wrap the line on @{}, save the file, refresh the page and get an error, reinsert the original line, save the file, and now it works.
Razor code rendered as whitespace
Hi
I have a small issue when rendering a contour form that the razor code in the view files is rendered as whitespace. This FieldType.Textfield.cshtml view is modified slightly but it's the same problem with the original:
@model Umbraco.Forms.Mvc.Models.FieldViewModel <div class="controls"> <input type="text" name="@Model.Name" id="@Model.Id" value="@Model.Value" maxlength="500" @{if(Model.Mandatory || Model.Validate){<text>data-val="true"</text>}} @{if (Model.Mandatory) {<text> data-val-required="@Model.RequiredErrorMessage"</text>}} @{if (Model.Validate) {<text> data-val-regex="@Model.InvalidErrorMessage" data-regex="@Model.Regex"</text>}} /> </div>The line
is rendered out as whitespace meaning " " is inserted between my label and the input field, and it messes with my layout.
How to fix this?
Kind Regards
Bo
This is bloody weird. If I remove the offending @model line, save the .cshtml, refresh the page, reinsert the line, save the .cshtml and refresh the page, it works! I have to the same over again on each FieldType.*.cshtml file though.
EDIT:
Actually that wasn't enough. You have to wrap the line on @{}, save the file, refresh the page and get an error, reinsert the original line, save the file, and now it works.
This line
should be wrapped like this
@{@model Umbraco.Forms.Mvc.Models.FieldViewModel
}
Save the file, and reload the page, and remove the wrap again, sa ve at it works.
Don't what is going on, but it doesn't make any sense
/Bo
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.