In my web application I have to provide a form for creating and editing. The forms for creating and for editing have minor differences, so I am thinking of doing something like this in my view:
<form>
// a lot of htnl goes here
@if (editing)
{
// some more fields shown in edit mode
}
@if(!editing)
{
// some stuff shown in create mode
}
I have always tried to not put any if
statements in my views, but this time I don’t see any other option except copying a huge portion of HTML in two places, which I don’t want to do. Is this proper “presentation logic” and are there any other options?