Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
@if (@Model.Value
<p> <time> @if (@Model.Value<DateTime>("handbuchgb") != DateTime.MinValue) { @(Model.Value<DateTime>("handbuchgb").ToString("dd.MM.yyyy")) } </time> </p>
you would normally use value != default(DateTime) for checks like that
value != default(DateTime)
also, your code outputs an empty time tag if the value is not set, and you also call a method multiple times...
@{ var handbuchgb = Model.Value<DateTime>("handbuchgb"); } <p> @if (handbuchgb!=default(DateTime)) { <time>@handbuchgb.ToString("dd.MM.yyyy")</time> } </p>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
if Model.Value datetime is null
you would normally use
value != default(DateTime)
for checks like thatalso, your code outputs an empty time tag if the value is not set, and you also call a method multiple times...
is working on a reply...