When using a partial view in ASP.NET MVC to encapsulate the creating/editing markup, what is the best way to change which control gets rendered based on the action?
For example, I want to only allow an email address to be entered upon account creation (via a textbox) and then viewable (via plain HTML) when viewing the account.
In pseudo-code, I'm expecting something like this:
<% if(Action == Create) {
Html.TextBox("EmailAddress")
} else {
Html.Encode(Model.Person.EmailAddress)
} %>
Any suggestions?