Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

What is the best practise for Passing the Data into the database ?

is it passing the Formcollection or Model?

SQL
[HttpPost]
public ActionResult Create(FormCollection collection)
{

}


or 

<pre lang="sql">[HttpPost]
public ActionResult Create(ModelName model)
{

}
Posted

1 solution

Passing the Model from view to Controller and vice-versa is the suggested best practice.

Go through link Implementing ASP.NET MVC Views in three different ways[^] to undersand in detail.

Thanks,
Kiran
 
Share this answer
 

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