Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
134 Points
39 Posts
Mar 25, 2012 07:17 PM|LINK
You can do in both ways. Using ajax and using the normal form posting approach.
With ajax
<input type="button" id="btnAdd" value="Add" />
and in your javascript
$("#btnADd").click(function(){
$.post("yourcontroller/youraction?"+prod="+$("hdnProductId").val()+"&qty="+$("txtQty").val(),function(data){
//Do with the response data
});
You can add the new item to tge kof available items in javasrtipt itseld using the jQuery append() method or you can do a get call fro a partia view which lists all the products.
kshyju
Member
134 Points
39 Posts
Re: Razor View - Build up a table of products
Mar 25, 2012 07:17 PM|LINK
You can do in both ways. Using ajax and using the normal form posting approach.
With ajax
<input type="button" id="btnAdd" value="Add" />
and in your javascript
$("#btnADd").click(function(){
$.post("yourcontroller/youraction?"+prod="+$("hdnProductId").val()+"&qty="+$("txtQty").val(),function(data){
//Do with the response data
});
});
You can add the new item to tge kof available items in javasrtipt itseld using the jQuery append() method or you can do a get call fro a partia view which lists all the products.
My flarack profile