have an editor template that can be rendered 0 to n times on a given page:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NewEmployee.Models.RequestedAccessViewModel>" %>
<fieldset style="display: inline;">
<legend>
<%: Model.Description %></legend>
<div class="editor-label">
<%: Html.LabelFor(model => model.Requested) %>
<%: Html.CheckBoxFor(model => model.Requested)%>
</div>
<div class="editor-field">
<%: Html.TextAreaFor(model => model.Comments) %>
</div>
<%: Html.HiddenFor(model => model.Description) %>
<%: Html.HiddenFor(model => model.Id) %>
</fieldset>
What I’d really like is the ‘Comments’ text area to be hidden initially, and slide down into view when the check box is hit, and slide back out if the checkbox is turned off again.
I know how I would do this with traditinal asp.net, but am at a loss with MVC2.
Use a jQuery function like this