<%foreach (var indication in Model.FindAll(m => m.Model != null && m.Model.Trx != null).OrderBy(m => m.Model.Trx.PrimarySponsor.Company))
{ %>
<tr>
<td><%= indication.DisplayUser %></td>
<td><%= indication.ActiveIndicationUsers[0].FullName %></td>
<td><%= string.IsNullOrEmpty(indication.Model.Trx.PrimarySponsor.Company) ? "Not Yet Saved" : indication.Model.Trx.PrimarySponsor.Company %></td>
<td><%= indication.TimeOpened.ToString(Chatham.Web.Data.Constants.Format.DateTimeSecondsFormatString) %></td>
<td><%= indication.Model.Trx.ProductCollection[0].ProductTypeFriendlyName %></td>
<td><%= (!indication.Model.Trx.ID.HasValue) ? "Not Yet Saved" : indication.Model.Trx.ID.Value.ToString() %></td>
<td><input type="button" value="Open" name="<%= (!indication.Model.Trx.ID.HasValue) ? "Not Yet Saved" : indication.Model.Trx.ID.Value.ToString() %>" /></td>
</tr>
<%} %>
所以這上面的表格,你可以看到,是動態生成的。如何處理按鈕點擊?我也想將按鈕的name
屬性傳遞給處理按鈕點擊的任何方法。處理按鈕點擊
謝謝!
不錯!謝謝! – slandau 2011-04-11 15:50:55
另外,請記住.delegate更好,更有針對性,在1.4.2之後綁定jquery。 http://brandonaaron.net/blog/2010/03/4/event-delegation-with-jquery – 2011-04-11 16:25:27
@Zach:Thx的鏈接。 – Chandu 2011-04-11 16:45:02