asp.net mvc post variable to controller
Posted
by Erwin
on Stack Overflow
See other posts from Stack Overflow
or by Erwin
Published on 2010-03-23T11:40:07Z
Indexed on
2010/03/23
11:43 UTC
Read the original article
Hit count: 481
Hello fellow programmer
I came from PHP language(codeigniter), but now I learning ASP.Net MVC :)
In PHP codeigniter we can catch the post variable easily with
$this->input->post("theinput");
I know that in ASP.Net MVC we can create an action method that will accepts variable from post request like this
public ActionResult Edit(string theinput)
Or by
public ActionResult Edit(FormCollection formCol)
Is there a way to catch post variable in ASP.Net like PHP's codeigniter, so that we don't have to write FormCollection object nor have to write parameter in the action method (because it can get very crowded there if we pass many variable into it)
Is there a simple getter method from ASP.Net to catch these post variables?
© Stack Overflow or respective owner