Im using asp.net mvc. I have a create and edit form which are very similar so im using a user control for the form.
and placing that in each view.
the form is very slightly different on the edit form eg it has some extra text and a link.
how can i show/hide that based on the view im in?
I would either put it in the model (i.e. an “IsEditMode” or “IsAddMode” parameter) or, better yet, pass it in via the ViewData:
Then just check for the IsEditMode value in the ViewData