I have action
that sends by parameters the codCliente
:
//master/CadastrarEndereco?codigoCliente=1011
How do I get this value codigoCliente
in my controller so that I can persist the value in the DB?
I have action
that sends by parameters the codCliente
:
//master/CadastrarEndereco?codigoCliente=1011
How do I get this value codigoCliente
in my controller so that I can persist the value in the DB?
In your CadastrarEndereco
method you can declare the codigoCliente
parameter as follows and use it.
public ActionResult CadastrarEndereco(int codigoCliente){
// codigoCliente preenchido aqui dentro
}
You can also access the object Request
to get the parameters sent:
var codigoCliente = Request.QueryString["codigoCliente"];