Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can i send table data to controller from razor view? if yes how?
Posted

Anticipating that you need to pass parameter values to an action method from razor view,
@Html.ActionLink("Submit", "Submit", new { id =  Model.ID, name = Model.Name}, 
new {id = "lnkSubmit" }) 
//First new is the parameters, second one is the unique id used for jqeury                  purposes


May be you want to send form data values on submit. You need to pass through ajax calls from script like below:
$.ajax({
type:"POST",
url:"/Home/SubmitForm",
data:$("#formValuesSubmit").serialize(),
success: function(){
//anything you want on success...
}
});

Hope this helps you.
I have anticipated and answered your question. If you had something else in mind, please comment.
Thanks.
:)
 
Share this answer
 
 
Share this answer
 
Comments
souvikcode 25-Jan-17 3:02am    
This is not solution. See if one use jquery to append tr to table. How can I use @html for a tr?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900