如何将 jquery 动画添加到 mvc 2 渲染控件?
有一个可以在给定页面上呈现 0 到 n 次的编辑器模板:
<%@ 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>
我真正想要的是最初隐藏“注释”文本区域,并在单击复选框时向下滑动到视图中,然后滑回如果该复选框再次关闭,则退出。
我知道如何使用传统的 asp.net 来做到这一点,但对 MVC2 却不知所措。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用像这样的 jQuery 函数
Use a jQuery function like this