Whats the use of string Command parameter in create method

Posted by Swappy_Gaj under ASP.NET MVC on 1/27/2015 | Points: 10 | Views : 550 | Status : [Member] | Replies : 1
Whats the use of string Command parameter in Create method;

//Create(User user, string Command)

public ActionResult Create(User user, string Command)
{
if (ModelState.IsValid)
{
db.Users.Add(user);
db.SaveChanges();
TempData["Msg"] = "Data has been saved succeessfully";
return RedirectToAction("Index");
}


ALSO THIS:
lnkCreate is ID of Create New Link:
Use of url = $(this).attr('href');
$("#lnkCreate").live("click", function (e) {
//e.preventDefault(); //use this or return false
url = $(this).attr('href');
$("#dialog-edit").dialog('open');

return false;
});




Responses

Posted by: Jitendrasoft09 on: 1/31/2015 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,

Create method where we create an object of model and insert the entered data(from form) in database or collection, please refer below link for more details-

http://www.asp.net/mvc/overview/older-versions-1/getting-started-with-mvc/getting-started-with-mvc-part6

Jitendra Kumar
If my post helps you, plz mark as an answer.

Swappy_Gaj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response