MVC: JQuery onchange event in an EditorTemplate

I have a grid with 2 checkboxes. When I check one, I want the other to be unchecked. This can be done in JQuery, but I am not clear how. To make this work I need to know the row index of where the checkbox is clicked. So the Editor Template looks like; <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%: string.Format("{0} {1}", Model.Forename, Model.Surname) %> <%: String.Format("{0:ddd, MMM d, yyyy}", Model.RequestDate) %> <%: Model.Type %> <%: String.Format("{0:ddd, MMM d, yyyy}", Model.AnnualLeaveDate) %> <%: Html.CheckBoxFor(model => model.ApproveFlag) %> <%: Html.CheckBoxFor(model => model.RejectFlag) %> <%: Html.TextAreaFor(model => model.Reason) %> And the page source looks like (first 2 rows of many). You can see the index of the for within the id and name of the element; . . .

以上就是MVC: JQuery onchange event in an EditorTemplate的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准





xaviar caviar Mon, Nov 29, 2010 Request Mon, Feb 1, 2010
xaviar caviar Wed, Dec 8, 2010 Request Tue, Nov 2, 2010