@Rex
the way to do your example is simple.
make some repeater control
<table id="suppliers" >
<tbody>
<asp:Repeater ID = "rptSuppliers" runat = "server">
<ItemTemplate>
<tr style = "padding:10px;" class = "supplier" tag = '<%# Eval("ID") %>' id = 'supplier_<%# Eval("ID") %>'>
<td style = "width:200px;">ספק: <%# Eval("Supplier.Group.GroupName") %></td>
<td style = "width:200px;">איש קשר: <%# Eval("Supplier.Profile.ProfileData.FullName")%></td>
<td>מחיר:
<%--כדי שהולדיאציה תבוצע כיאות לשדה צריך להיות שם ומזהה זהים אבל ייחודיים--%>
<input class = "required price" name ="price<%# Eval("Supplier.ID") %>" id = "price<%# Eval("Supplier.ID") %>" type="text" value = '<%# Eval("Price","{0:n2}") %>' min ="0" style ="width:60px;"/>
<input class ="supplier_id" type ="hidden" value = '<%# Eval("Supplier.ID") %>' />
</td>
<td style = "padding-right:10px;">
<img src ="../../Images/remove40_32x32.gif" height ="16" width = "16" title = 'הסר' style = "float:right;" id = "sremove"
onclick = "removeClick(this)"
onmouseout = "removeOut(this)"
onmouseover = "removeOver(this)" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
just bind onload some data
rptSuppliers.DataSource = product.Suppliers;
rptSuppliers.DataBind();
and the most important is the client side.
you can make some identical content tamplaete to the repeater the tamplate is ganerated by mTamplate jquery plugin.
<script type="text/html" id="suppliers_tmpl">
<tr style = "padding:10px;" class = "supplier" tag = '<#= ID #>' id = 'supplier_<#= ID #>'>
<td style = "width:200px;">ספק: <#= Supplier #></td>
<td style = "width:200px;">איש קשר: <#= Contact #></td>
<td>מחיר:
<input class = "required price" name ="price<#= SupplierID #>" id = "price<#= SupplierID #>" type="text" value = '<#= Price #>' min ="0" style ="width:60px;"/>
<input class ="supplier_id" type ="hidden" value = '<#= SupplierID #>' />
</td>
<td style = "padding-right:10px;"><img src ="../../Images/remove40_32x32.gif" height ="16" width = "16" title = 'הסר' style = "float:right;" id = "sremove"
onclick = "removeClick(this)"
onmouseout = "removeOut(this)"
onmouseover = "removeOver(this)" />
</td>
</tr>
</script>
and then if you want to append this tamplate to your table
function UpdatesupplierItem(supplier) {
// Retrieve the Item template
var template = $("#suppliers_tmpl").html();
// Parse the template and merge stock data into it
var html = parseTemplate(template, supplier);
// Create jQuery object from gen'd html
var newItem = $(html);
var item_id = "supplier_" + supplier.SupplierID;
//נוסיף פריט רק במידה ואיננו קיים
var origItem = $("#" + item_id);
if (origItem.length < 1)
newItem.appendTo("#suppliers tbody");
else
origItem.after(newItem).remove();
return newItem;
}
make your html elements accessible for jquery (by id or class).
and go for it.
more info west-wind
there you can get some links to the source and you have wide examples..