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
I have a thing thtas been bugging me for a while, and im sure the answer is very simple.
<p> <a href="@page.Url"> <strong>Kl. @page.dato.ToString("HH:mm") @if(@page.HasValue("evtSluttidspunkt")){ - @page.evtSluttidspunkt } </a> </p>
Fails because of the html before the razor inside the if
<p> <a href="@page.Url"> <strong>Kl. @page.dato.ToString("HH:mm") @if(@page.HasValue("evtSluttidspunkt")){ @page.evtSluttidspunkt } </a> </p>
works fine.
How do i get the " - " rendered?
Try this:
<text> - </text>
Jeroen
Perfect :)
Hi Claus and Jeroen,I konw that I am a little bit late here.Razor’s @: and <text></text> syntax can then be used for scenarios where you want to avoid using an HTML element within a code container block.So you could also do:
@:-
/Dennis
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.
Continue discussion
syntax, html inside razor block
I have a thing thtas been bugging me for a while, and im sure the answer is very simple.
<p> <a href="@page.Url"> <strong>Kl. @page.dato.ToString("HH:mm") @if(@page.HasValue("evtSluttidspunkt")){ - @page.evtSluttidspunkt } </a> </p>
Fails because of the html before the razor inside the if
<p> <a href="@page.Url"> <strong>Kl. @page.dato.ToString("HH:mm") @if(@page.HasValue("evtSluttidspunkt")){ @page.evtSluttidspunkt } </a> </p>
works fine.
How do i get the " - " rendered?
Try this:
Jeroen
Perfect :)
Hi Claus and Jeroen,
I konw that I am a little bit late here.
Razor’s @: and <text></text> syntax can then be used for scenarios where you want to avoid using an HTML element within a code container block.
So you could also do:
/Dennis
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.