i have recently moved from ASP.Net WebForms to ASP.Net MVC and having trouble with deciding on how to move forward with a particular implementation of a Modal and GUI design.
This is the Model:

I want to design a Create page on which the User details can be entered, as well as a list (bootstrap-table) of User_Customers for that User.

When clicking on the green + button at the right-bottom, I would like to show a bootstrap modal window in which a User_Customer can be added.

I have thought of the following 2 options:
- Add the User_Customer on the client with jQuery. Use proper naming and indexes so that the list is received on the server when the User hits the "Create' button.
- Perform an intermediate postback and add the User_Customer on the server. Not sure what to add the User_Customer to, as the User record does not exist yet until the complete form is posted back.

Pinpoint SolutionsPosted Jan 21, 2015, 6:56 AM
Suraj SahooPosted Jan 14, 2015, 11:26 AM
Pinpoint SolutionsPosted Jan 14, 2015, 1:22 AM
Suraj SahooPosted Jan 13, 2015, 9:14 AM
On click on the Add button,
1-You need to make an ajax call with posting the data like:
$.ajax({
url:"/CONTROLLER/ACTION",
type:"POST",
data:$("#FORMID").serialize(), //serialize would send the form values in key value pair
success: function(){
$("#MODALID").modal('hide');
location.reload();//this method would let the grid on that page on window refresh and call the server and populate the data just added, so no need to postback again
}
});
I hope if my anticipation is correct this would help you.
Please post back your queries if any.
Thanks. :)
Pinpoint SolutionsPosted Jan 12, 2015, 4:09 AM